How to convert a matrix to cell array of vectors?

4 views (last 30 days)
I have a matrix M x N matrix: R. r1 = R(1,:); r2 = R(2,:); etc. How to create cell array {r1,r2,...} from R automatically?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 18 Oct 2016
out = num2cell(R,2);

More Answers (0)

Categories

Find more on Resizing and Reshaping Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!