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

 Accepted Answer

Looks correct. Means of columns 1 and 5, for instance, would look like this:
x = mean(w(:,[1 5]))
Best.

1 Comment

Thanks for answering my question. But how can I add the rest of the columns (1&5 2&6 3&7 etc...)?
Thanks

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!