the problem with mean function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Pedro Villena
le 8 Nov 2012
Modifié(e) : Pedro Villena
le 8 Nov 2012
mean_phase=mean(reshape(phase(1:25*floor(numel(phase)/25)),25,[]))
0 commentaires
Plus de réponses (1)
Rica
le 8 Nov 2012
1 commentaire
Andrei Bobrov
le 8 Nov 2012
Modifié(e) : Andrei Bobrov
le 8 Nov 2012
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));
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!