0
$\begingroup$

I have some sensor data stored in a 1000 x 5 matrix. I'd like to copy each column into a 5 x 1 cell array such that each cell contains a 1000 x 1 vector. I tried the num2cell(mymatrixname,1) function, but this created a cell array of 1 x 5, not 5 x 1. Using MATLAB, how can I do this in a compact way - without using a for loop?

Thanks,

kilosaw

$\endgroup$

1 Answer 1

1
$\begingroup$

Transpose it

y = num2cell(x,1)';
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.