Finding mean of data in array inside another array
1 回表示 (過去 30 日間)
古いコメントを表示
I copied data into a new variable called X, inwhich inside X there are 1851x1 array. Inside each array there are several number of data of array inside all 1851x1 array. How can I find the mean of each 1851 data. Thanks very much
0 件のコメント
採用された回答
Image Analyst
2023 年 12 月 12 日
Did you try the obvious brute force for loop method:
theMeans = zeros(numel(X), 1);
for k = 1 : numel(X)
% Get the mean of the 1851 element double vector that is
% inside the kth cell of the X cell array.
theMeans(k) = mean(X{k});
end
その他の回答 (1 件)
Jalal Khan
2023 年 12 月 12 日
cellfun(@mean,--) applies the mean function to each cell of the cell array and returns a numeric array containing the mean for each cell.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!