Field of a structure

2 次查看(过去 30 天)
FG
FG 2020-9-8
评论: FG 2020-9-8
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 个评论
Rik
Rik 2020-9-8
What did you try yourself?
FG
FG 2020-9-8
Tried this but did'nt work.. M = mean([T.HV3])

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2020-9-8
M = mean(T.HV3)
and then use writematrix.

更多回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by