how to convert a matrix to a cell?

1 view (last 30 days)
bay rem
bay rem on 13 Dec 2015
Edited: dpb on 13 Dec 2015
i have a 3*6 matrix :
26 197 27 197 28 197
26 196 27 196 28 196
26 195 27 195 28 195
and i want to covert it to a cell array :
[26,197] [27,197] [28,197]
[26,196] [27,196] [28,196]
[26,195] [27,195] [28,195]
I'm new to matlab and would appreciate any help.

Accepted Answer

dpb
dpb on 13 Dec 2015
Edited: dpb on 13 Dec 2015
c=mat2cell(m,ones(1,size(m,1)),2*ones(1,size(m,2)/2));
doc mat2cell % for details...

More Answers (0)

Categories

Find more on Multidimensional Arrays 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!