the Structure Setup
AppleDataGreen = struct('taste','Sour', 'color','Bright')AppleDataRed = struct('taste','Sweet', 'color','Bright')apples = struct( 'AppleType' ... , struct('Green',struct(AppleDataGreen) ... ,'Red', struct(AppleDataRed)) )
I have a code that I want to run the data in the green structure and then run the Red structure
From matlab I was trying to us a for loop by doing this
% this takes me to the green and red structure giving me a
% length 2 hopefully
for i=1:length(apples.AppleType) run(apples.AppleType{i}) codeend
error cell contents reference from a non-cell array object
Best Answer