MATLAB: How to conbine the array inside the structure structure For example, 1X10 StructStructure(1)=1X5 arrayStructure(2)=1X10 array Is there a way to combine it into 1X15 array? THanks Best Answer struct1=struct('f1',num2cell(1:10))struct2=struct('f2',num2cell(1:5))new_struct=struct('new_f',num2cell([struct1.f1 struct2.f2 ])) Related SolutionsMATLAB: How to create a structure YourStruct = struct('A', {cell(20,1)}, 'B', {zeros(20,1)}, 'C', {zeros(20,1)}, 'D', {zeros(20,1)}, 'E', {zeros(20,1)}, 'F', {zeros(20,1)});Or if you prefer,YourStruct.A = cell(20,1);for FN = 'BCDEF' YourStruct.(FN) = zeros(20,1);end MATLAB: Saving figures into structure Hey Jared,data = rand(10,2);myStruct.structFig = plot(data);myStruct.structData = data;m = figure(2);% does not actually work% % set(m,myStruct.structFig.XData,'XData');you should have a look at the set() command. I haven't found a solution yet. Easiest would be just plot the data again but here you loose all of your preset defines like thickness and such things. Related QuestionAccess data in structureHow to create a structureIs it possible: Split a structureAllow user to name structure
Best Answer