MATLAB: The problem with mean function

MATLABmeanreshape

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 ?

Best Answer

mean_phase=mean(reshape(phase(1:25*floor(numel(phase)/25)),25,[]))