필터 지우기
필터 지우기

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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by