NestedStruct - Represent a nested struct

版本 1.0.2 (2.5 KB) 作者: Eivind Hennestad
This is a class that will let you display values of all substructs of a struct.
5.0 次下载
更新 2023/12/9

查看许可证

Example:
nestedStruct = struct(...
'Subject', struct('Age', 25, 'Species', 'Mouse'), ...
'Experiment', struct('Date', '2023-01-01', 'Location', 'Lab') );
s = NestedStruct(nestedStruct);
>> s
s =
NestedStruct with properties:
Subject:
Age: 25
Species: 'Mouse'
Experiment:
Date: '2023-01-01'
Location: 'Lab'
Ideas:
  • Better display for struct with mix of substructs and values which are not struct
  • Support for multiple nesting levels (if possible?)

引用格式

Eivind Hennestad (2026). NestedStruct - Represent a nested struct (https://ww2.mathworks.cn/matlabcentral/fileexchange/156199-nestedstruct-represent-a-nested-struct), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2023b
与 R2021b 及更高版本兼容
平台兼容性
Windows macOS Linux
版本 已发布 发行说明
1.0.2

Fields that are not substructs are added as dynamic properties and displayed normally.
Indexing a subtract which has substructs will return a new NestedStruct

1.0.1

Update description

1.0.0