Mean value in a cell array
Afficher commentaires plus anciens
Hi!
I have a 16x8 cell (containing 6x11 cells) with the name FinalResult. I now would like to calculate the mean value of FinalResult{1:16,4}(1,2) and have tried it with
cellfun(@mean,FinalResult{1:16,4}(1,2))
but this will give me the error message "Bad cell reference operation". Where is the mistake?
Thank you in advance for any help.
Réponse acceptée
Plus de réponses (1)
Put square brackets around the cellarray contents like:
M = [FinalResult{1:16,4}]
m = mean(M,2);
Putting the square brackets converts it into a matrix.
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!