How to retrieve data in column wise in Matlab?

A=ans(:,1) This gives the data only for 1st column from a table. Like wise I want to get the data of 4th column as well. How do I retrieve both 1st and 4th columns data in Matlab? What is the command for that?

 Accepted Answer

A(:, [1 4])

1 Comment

Thank you!! It is correct for my task. Sir,How can I save the matlab output as a text file in a separate location?

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

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

Start Hunting!