Field of a structure

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 Commenti

Rik
Rik il 8 Set 2020
What did you try yourself?
FG
FG il 8 Set 2020
Tried this but did'nt work.. M = mean([T.HV3])

Accedi per commentare.

 Risposta accettata

Stephen23
Stephen23 il 8 Set 2020
M = mean(T.HV3)
and then use writematrix.

2 Commenti

FG
FG il 8 Set 2020
It gives a NaN
FG
FG il 8 Set 2020
Guess I found it..

Accedi per commentare.

Più risposte (1)

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

Categorie

Scopri di più su MATLAB in Centro assistenza e File Exchange

Prodotti

Release

R2020a

Richiesto:

FG
il 8 Set 2020

Commentato:

FG
il 8 Set 2020

Community Treasure Hunt

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

Start Hunting!

Translated by