Access/calculate Matrices within a Cell Array
显示 更早的评论
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 个)
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 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!