Looping over inputs provided by structure
이전 댓글 표시
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})
code
end
error cell contents reference from a non-cell array object
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!