How can I choose a set of columns from my table. I have to get the means of let's say columns 1 and 5, columns 2 and 6 etc from 20 columns. Thanks
1 次查看(过去 30 天)
显示 更早的评论
Does this look like a correct line of code? x = mean(w(:,[1:4:10 11:4:20]));
0 个评论
采纳的回答
Sadik
2017-5-26
Looks correct. Means of columns 1 and 5, for instance, would look like this:
x = mean(w(:,[1 5]))
Best.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!