Borrar filtros
Borrar filtros

Field of a structure

1 visualización (últimos 30 días)
FG
FG el 8 de Sept. de 2020
Comentada: FG el 8 de Sept. de 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 comentarios
Rik
Rik el 8 de Sept. de 2020
What did you try yourself?
FG
FG el 8 de Sept. de 2020
Tried this but did'nt work.. M = mean([T.HV3])

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 8 de Sept. de 2020
M = mean(T.HV3)
and then use writematrix.
  2 comentarios
FG
FG el 8 de Sept. de 2020
It gives a NaN
FG
FG el 8 de Sept. de 2020
Guess I found it..

Iniciar sesión para comentar.

Más respuestas (1)

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

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by