How to averaging each each row in cell array?

조회 수: 2 (최근 30일)
Tyann Hardyn
Tyann Hardyn 2022년 6월 29일
댓글: Tyann Hardyn 2022년 6월 30일
Hi, Community...
I just want to ask, how to averaging each of my cell array according to the row?
i want to average dst_allfiles{1}(1), dst_allfiles{2}(1), dst_allfiles{3}(1)
then
mean(dst_allfiles{1}(2), dst_allfiles{2}(2), dst_allfiles{3}(2))
mean(dst_allfiles{1}(3), dst_allfiles{2}(3), dst_allfiles{3}(3))
............................
How to do that? Thank you....

채택된 답변

David Hill
David Hill 2022년 6월 30일
d=cell2mat(dst_allfiles);
m=mean(d,2);
  댓글 수: 3
David Hill
David Hill 2022년 6월 30일
mean(d,1);%mean along columns
mean(d,2);%mean along rows
See mean documentation
Tyann Hardyn
Tyann Hardyn 2022년 6월 30일
Thank you so much, bro. You helped me so much....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by