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!