multi dimensional array and the mean function
4 次查看(过去 30 天)
显示 更早的评论
Hi!
How to apply the mean function on multidimenssional array?
% A=[1 2 3; 4 5 6]---> B=mean(A,2).
how to applay it on an array of the size 10*1*30?
Thnk you
0 个评论
回答(2 个)
Jan
2012-11-19
There is no need to squeeze:
B = mean(A, 3)
The result is [10 x 1], because trailing singleton dimensions are reduced automatically, e.g. [10 x 1 x 1] gets [10 x 1] without calling squeeze.
Try size(zeros(10, 1, 1)).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!