You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
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?)
Cite As
Eivind Hennestad (2026). NestedStruct - Represent a nested struct (https://www.mathworks.com/matlabcentral/fileexchange/156199-nestedstruct-represent-a-nested-struct), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.2 (2.49 KB)
MATLAB Release Compatibility
- Compatible with R2021b and later releases
Platform Compatibility
- Windows
- macOS
- Linux
