Field of a structure

5 Ansichten (letzte 30 Tage)
FG
FG am 8 Sep. 2020
Kommentiert: FG am 8 Sep. 2020
As Stephen Cobeldick helped me yesterday, I have a structure T consisting of 4 fields. I want to calculate the mean of each field in T.. Then I want all them to be written in an excel file. Thnx..
  2 Kommentare
Rik
Rik am 8 Sep. 2020
What did you try yourself?
FG
FG am 8 Sep. 2020
Tried this but did'nt work.. M = mean([T.HV3])

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Stephen23
Stephen23 am 8 Sep. 2020
M = mean(T.HV3)
and then use writematrix.
  2 Kommentare
FG
FG am 8 Sep. 2020
It gives a NaN
FG
FG am 8 Sep. 2020
Guess I found it..

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

madhan ravi
madhan ravi am 8 Sep. 2020
D = structfun(@mean, T);
writetable(table(D), 'Sample.xlsx') % or writematrix() as Stephen suggested

Kategorien

Mehr zu Cell Arrays finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by