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