struct2char
Version 1.0.4 (1.79 KB) by
Mukund Iyer
Convert the contents of a structure into a single array of characters.
Convert the contents of a structure into a single string.
M = STRUCT2CHAR(C) converts a multi-field structure into a single array of characters. The output is of character data type. In case of nested structure, it goes recursive and converts them into an array of characters.
STRUCT2CHAR is not supported for array of structures as input.
Example:
C.Name = 'Albert';
C.Age = '24';
C.Height = '180 cm';
M = struct2char(C)
Cite As
Mukund Iyer (2024). struct2char (https://www.mathworks.com/matlabcentral/fileexchange/103220-struct2char), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2016b
Compatible with R2016b and later releases
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.4 | Source code uploaded instead of P-Code. Compatibility details changed. |
||
1.0.3 | Error messages were updated and error handling for array of structures as input was also updated. |
||
1.0.2 | Uploaded P-Code instead of source code. |
||
1.0.1 | Copyright notice was updated. |
||
1.0.0 |