Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
combined operations on struct arrays
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Azzi Abdelmalek
am 1 Mai 2013
Bearbeitet: Azzi Abdelmalek
am 1 Mai 2013
S=struct('a',cellfun(@plus, {S.a},{5 6 7},'un',0))
4 Kommentare
Azzi Abdelmalek
am 1 Mai 2013
Bearbeitet: Azzi Abdelmalek
am 1 Mai 2013
What do you mean by readable?
doc cellfun
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!