Field of a structure

4 vues (au cours des 30 derniers jours)
FG
FG le 8 Sep 2020
Commenté : FG le 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 commentaires
Rik
Rik le 8 Sep 2020
What did you try yourself?
FG
FG le 8 Sep 2020
Tried this but did'nt work.. M = mean([T.HV3])

Connectez-vous pour commenter.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (1)

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

Catégories

En savoir plus sur Cell Arrays dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by