Field of a structure

1 回表示 (過去 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.
  2 件のコメント
FG
FG 2020 年 9 月 8 日
It gives a NaN
FG
FG 2020 年 9 月 8 日
Guess I found it..

サインインしてコメントする。

その他の回答 (1 件)

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

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by