I am having difficulty with MATLAB. I have 106 columns and 1 row. Each cell in each row contains a different amount of numbers. If I type result{1} I get 7. If I type result{2}, I get 3 numbers, etc... How can I list all the numbers out in the column instead of having individual cells. I know I need to make a zeros matrix but I am not sure about the syntax.
Asked
Active
Viewed 1,102 times
-1
2 Answers
1
Maybe you could 1) Find the maximal number of numbers. 2) Append the missing number of numbers (zeros) to each cell. 3) Use cell2mat.
This may be wasteful, of course, if there are lots of zeros.
user66081
- 3,987
- 17
- 29
-
I am not really sure how to do that so I do not know if the answer is right or not. – Jackson Hart Jan 13 '14 at 21:11
1
If I understand your question correctly:
>> myCell = {1,[2 3 4],[10 11]}; %// for example
>> [myCell{:}]
ans =
1 2 3 4 10 11
Luis Mendo
- 1,834
size)? In any case, this question is off-topic as it doesn't relate to mathematics but rather to programming. You can ask such questions at StackOverflow/Matlab. – horchler Jan 13 '14 at 21:47