cell配列の加算平均をしたい
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Cell配列の加算平均をしたいです。
testdataは1×2のcell配列ですが、実際には1×10程度になるかと思います。
Cell配列の中には、8×1001配列が格納されています。
具体的には、それぞれのcellの1〜8列目をそれぞれ抜き出し平均し、
最終的に8×1001配列にしたい思っております。
よろしくお願いします。
Réponse acceptée
Atsushi Ueno
le 10 Fév 2023
cell 配列から行列に変換し、更に2次元⇒3次元に変換すれば「各頁の要素の平均」となり分かり易いと思います
websave('testdata','https://jp.mathworks.com/matlabcentral/answers/uploaded_files/1291545/testdata.mat');
load('testdata.mat');
testdata_mat = reshape(cell2mat(testdata),8,1001,[]); % cell 配列から行列に変換、2次元⇒3次元に変換
result = mean(testdata_mat,3)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!