Access/calculate Matrices within a Cell Array

1 次查看(过去 30 天)
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
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?

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by