Multiplying structure array with a scaler
23 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aldrich Dias
am 22 Mär. 2021
Beantwortet: Matt J
am 22 Mär. 2021
I have Data.mat file that is a 1x365 structure array and i would like to multiply all the values of the 4th column by 2 and store them in to a variable.
1 Kommentar
Akzeptierte Antwort
Matt J
am 22 Mär. 2021
If you mean you want to multiply all the fields by 2,
s0.a=1;s0.b=2;s0.c=3 %example struct
s=structfun(@(f)2*f, s0,'uni',0)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!