フィルターのクリア

Calculate mean value of every element of a .mat file

4 ビュー (過去 30 日間)
Jon Ordóñez Devesa
Jon Ordóñez Devesa 2022 年 5 月 20 日
I have a .mat file which contains 300 matrixes all of which have the same dimensions of 256x320. I want to calculate the mean value of each matrix, with a for circle maybe, thus obtaining 300 vectors. Then I want to put all those vectors in a single matrix. Thanks in advance.
  2 件のコメント
KSSV
KSSV 2022 年 5 月 20 日
Load the data and use mean.
Matt J
Matt J 2022 年 5 月 20 日
編集済み: Matt J 2022 年 5 月 20 日
I want to calculate the mean value of each matrix, with a for circle maybe, thus obtaining 300 vectors.
What do you mean 300 vectors? Wouldn't the mean over the entire matrix give you a scalar?

サインインしてコメントする。

採用された回答

Matt J
Matt J 2022 年 5 月 20 日
編集済み: Matt J 2022 年 5 月 20 日
S = structfun( @mean, load('yourFile.mat'),'uni',0);
matrix=cell2mat(struct2cell(S));

その他の回答 (1 件)

Ilya Dikariev
Ilya Dikariev 2022 年 5 月 20 日
singleMatrix=zeros(size(oldMatrix));
for i=1:length(singleMatrix)
singlematrix=mean(oldMatrix);
end
that should work if you want your end matrix in a single row

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by