Convert column into cells
33 views (last 30 days)
Marcus Glover on 11 Jul 2016
I have a large cell matrix with each cell as 1x1 as some entries are strings and other types of imported data. I need to multiply two columns together, as well as a scalar.
The multiplication of coulumns part I have done like this:
But I can't seem to multiply by my scalar without running into problems. I can get the correct column of numbers I need like this:
But now I can't convert this back into cells in order to put back into final(:,5). Conversion to cell from double is not possible. mat2cell seem to give me just one cell, but I need a column of individual cells (7108x1).
I have to have final(:,5) be these numbers, I don't care what type it is really as it will be exported as .xls.
More Answers (1)
Star Strider on 12 Jul 2016
If you need a column of individual cells from mat2cell. you have to give it a vector of ones.
v = ...; % Numeric Vector
cv = mat2cell(v, ones(7108,1), 1); % Cell Array