the problem with mean function
3 次查看(过去 30 天)
显示 更早的评论
i use this function to build the mean of vector:
% mean_phase=mean(reshape(phase(:),25,[]))
i get this error with the size of the vector:
*Product of known dimensions, 25, not divisible into total number of elements*
How could i solve this Problem ?
0 个评论
采纳的回答
Pedro Villena
2012-11-8
编辑:Pedro Villena
2012-11-8
mean_phase=mean(reshape(phase(1:25*floor(numel(phase)/25)),25,[]))
0 个评论
更多回答(1 个)
Rica
2012-11-8
1 个评论
Andrei Bobrov
2012-11-8
编辑:Andrei Bobrov
2012-11-8
use Statistics Toolbox
nanmean(reshape([phase(:);nan(mod(-numel(phase),25),1)],25,[]));
or use Image Processing Toolbox
blockproc(phase(:),[25,1],@(x)mean(x.data));
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!