MATLAB: Question about structures in Matlab structures Can you have a structure within a structure in Matlab? Best Answer Yes, that's possible:s = struct('field1', 45, 'field2', 'Nothing')s.field3 = struct('subfield1', 232)And you can access:s.field3.subfield1 Related SolutionsMATLAB: Comparing two structures and find the common common_fields = intersect( fieldnames(structure1), fieldnames(structure2));for fn = common_fields this = fn{1}; new_struct(1).(this) = structure1.(this); new_struct(2).(this) = structure2.(this);end MATLAB: Array of structures containing arrays s(1) = struct('field1', [1:3;4:6]);s(2) = struct('field1', [4:6;1:3]);z = cell2mat(struct2cell(s))out = squeeze(z(1,3,:))' Related QuestionArray of structures in matlabHow to access nested MATLAB structure fields in the MEX programHow to preallocate memory for a structure in MATLAB 7.6 (R2008a)
Best Answer