I have a 51x13 cell array which contains 1x1 struct arrays and therein are many different matrices.
I want to calculate the mean of selected matrices of certain rows and columns in that cell array and save the results in one matrices.
My approach : Allmean= [mean(P{9:51,1}.selectedMatrice)]
with the Error form Matlab : "Expected one output from a curly brace or dot indexing expression, but there were 43 results"
Wich possibilitys there are? (maybe for loop?) How can I do that ?

답변 (1개)

Jan
Jan 2021년 4월 8일
편집: Jan 2021년 4월 8일

0 개 추천

The desctiption of the data as text is less clear than posting some code, which produces example data.
With some guessing:
Allmean= mean([P{9:51,1}.selectedMatrice])
But I'm afraid this does not change the problem. Your data representation is extremely unuseful to perform calculations. Would it be possible to create a struct array instead of the cell array containing structs?

카테고리

도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

릴리스

R2020b

질문:

2021년 4월 8일

편집:

Jan
2021년 4월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by