Mean value in a cell array
显示 更早的评论
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.
采纳的回答
更多回答(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.
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!