MATLAB Answers

0

From cells to vectors with doubles with loop.

Asked by Kelly Kyriakou on 15 Nov 2015
Latest activity Edited by Kelly Kyriakou on 15 Nov 2015
Accepted Answer by Jan
I have this variable which is 1x24 cells and it's like this: [10 7] [13 7;12 7;10 7] [13 7;12 7;10 7] [10 7] [13 7;12 7;10]. I want them to be in vectors like this: 10 7; 13 7; 12 7; 10 7 et.c I wrote a loop for this and it is transposed as I want but it stores only the last value. How I could store all values?
for zena = 1:size(anteola,2)
getresults = results{zena}
assignin('base','colla',getresults(:))
end
Thank you in advance

  1 Comment

Jan
on 15 Nov 2015
Do you see that the missing formatting let your question look strange? "vectors like this: 10 7 13 7 12 7 10 7"?!

Sign in to comment.

1 Answer

Answer by Jan
on 15 Nov 2015
 Accepted Answer

Return the value of results as an output argument of your function. Creating variables remotely in another workspace is prone to bugs, because it makes it much harder to keep the overview. So my advice is: Avoid assignin strictly.

  0 Comments

Sign in to comment.