nestedstruct2cell

版本 1.0.0.0 (1.1 KB) 作者: Todd Pataky
NESTEDSTRUCT2CELL converts a nested 1x1 structure array into an MxN cell array
1.2K 次下载
更新时间 2006/5/26

无许可证

NESTEDSTRUCT2CELL allows for workspace visualization of nested structural arrays, and also offers an alternative method of constructing nested structures through its companion function CELL2NESTEDSTRUCT (also available at MATLAB Central).

Example:

clear S;
S.water.a=111;
S.water.b=222;
S.melon=[];
S.a.b.c.d.e='aaa';
S.q.r=cell(6,2);
[C] = nestedstruct2cell(S)

C =

'water' 'a' '' '' '' [ 111]
'water' 'b' '' '' '' [ 222]
'melon' '' '' '' '' []
'a' 'b' 'c' 'd' 'e' 'aaa'
'q' 'r' '' '' '' {6x2 cell}

Data is stored in the final column irrespective of the nesting level of a given branch. Empty cells indicate that the branch is terminated at the leftmost non-empty nesting level.

引用格式

Todd Pataky (2024). nestedstruct2cell (https://www.mathworks.com/matlabcentral/fileexchange/11203-nestedstruct2cell), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13SP1
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Types 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0