the problem with mean function
조회 수: 2 (최근 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));
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!