Info
この質問は閉じられています。 編集または回答するには再度開いてください。
combined operations on struct arrays
2 ビュー (過去 30 日間)
古いコメントを表示
I have a struct S
S=struct()
It has 2 fields a,b
S(1).a=2;
S(2).a=3;
S(3).a=4;
now how do i do something like
S(:).a=S(:).a+[ 5 6 7 ]
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2013 年 5 月 1 日
編集済み: Azzi Abdelmalek
2013 年 5 月 1 日
S=struct('a',cellfun(@plus, {S.a},{5 6 7},'un',0))
4 件のコメント
Azzi Abdelmalek
2013 年 5 月 1 日
編集済み: Azzi Abdelmalek
2013 年 5 月 1 日
What do you mean by readable?
doc cellfun
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!