How to sum field elements inside a large structure array.

조회 수: 42(최근 30일)
I have mat. data file with the follwoing spes:
data=load('load_models.mat', 'models')
data =
struct with fields:
models: {1000×1 cell}
>> models
models =
1000×1 cell array
0 {1440×3 double}
1 {1440×3 double}
: :
999 {1440×3 double}
Each cell of the 1000 rows contais (1440×3) matrix.
What I want to get is a new array of size (1440×3), where the elemnts of the new array is the summation of corresponding individal feild elements of the whole 1000×1 struct.
Any fuction of example approch can help me achive my opjective?

채택된 답변

Image Analyst
Image Analyst 2021년 6월 5일
Try mean() and cell2mat(). If that does not work, can you attach your .mat file with the paperclip icon (if it's less than 5 MB in size).
  댓글 수: 3
Nasser Alqurishi
Nasser Alqurishi 2021년 6월 5일
It worked perfeclty!. Many thanks

댓글을 달려면 로그인하십시오.

추가 답변(0개)

범주

Find more on Data Type Conversion in Help Center and File Exchange

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by