Mean of a 3D cell

1 回表示 (過去 30 日間)
Alexandra Tzilivaki
Alexandra Tzilivaki 2016 年 4 月 5 日
編集済み: Azzi Abdelmalek 2016 年 4 月 5 日
Hello everyone!
I would be much appreciated if you can help dealing with an easy problem
I have a cell called voltage with dimensions 10x48x28. Each one of the 10 contains a double with size 10x10000. I would like to calculate the mean in order to have 28x48 cell.
Thank you in advance for your kind help and support! Alexandra
  1 件のコメント
Matthew Eicholtz
Matthew Eicholtz 2016 年 4 月 5 日
Do you want the size of each cell in the mean array (28x48) to be 10x10000? Or something else?

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

回答 (2 件)

Image Analyst
Image Analyst 2016 年 4 月 5 日
See cellfunc()

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 5 日
編集済み: Azzi Abdelmalek 2016 年 4 月 5 日
[n,m,p]=size(voltage);
v=cell2mat(voltage);
w=permute(v,[2 1 3]);
[ii,jj,kk]=size(v);
for k=1:p
f(:,:,k)=mean(reshape(w(:,:,k),jj,10,[]),3)';
end
out=mat2cell(f,2,ones(1,jj),ones(1,kk));
d=permute(out,([2 3 1]));

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by