How to averaging each each row in cell array?

1 Ansicht (letzte 30 Tage)
Tyann Hardyn
Tyann Hardyn am 29 Jun. 2022
Kommentiert: Tyann Hardyn am 30 Jun. 2022
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....

Akzeptierte Antwort

David Hill
David Hill am 30 Jun. 2022
d=cell2mat(dst_allfiles);
m=mean(d,2);
  3 Kommentare
David Hill
David Hill am 30 Jun. 2022
mean(d,1);%mean along columns
mean(d,2);%mean along rows
See mean documentation
Tyann Hardyn
Tyann Hardyn am 30 Jun. 2022
Thank you so much, bro. You helped me so much....

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by