Why do I get the error "Subscripted assignment dimension mismatch" when using a cell array in a structure field?
이전 댓글 표시
I have the following lines of code which work:
layers(1)=struct('test', 'ABC', 'value', 0.50);
layers(2)=struct('test', 'DEF', 'value', []);
I would like to combine the "test" and "value" fields into a single field like this:
layers(1)=struct('test', {'ABC', 0.50});
layers(2)=struct('test', {'DEF'});
This gives the error message "Subscripted assignment dimension mismatch."
Is there a way to put a 1x2 cell into a single field in the structure?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!