Modify values in a struct array
古いコメントを表示
I would like to modify the values of a field of a struct array (without using a for loop). If my initial struct array is the following:
a.b(1).c = 5;
a.b(2).c = 5;
a.b(3).c = 5;
I would like to modify it such that:
a.b(1).c = 1
a.b(2).c = 2
a.b(3).c = 3
I thought that
[a.b.c] = [1:3]
would work, but it doesn't: Insufficient number of outputs from right hand side of equal sign to satisfy assignment.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!