Store answers in multiple variables?
Ältere Kommentare anzeigen
Hello,
I have a variable B which outputs about 100 cells. Assuming N = 4, how do I go about obtaining cell2mat(B(N(1)) in a new variable x_1, cell2mat(B(N(2)) in x_2, and so forth? Currently I am using:
for cnt = 1:N
hold on;
x = cell2mat(B(cnt));
end
Thanks in advance!
-- Jake
2 Kommentare
Daniel Shub
am 28 Sep. 2011
In general, you probably do not want to be doing this. Why do you want x1, x2, ... It is only going to lead to evil eval statements later.
Jake Bolanski
am 1 Okt. 2011
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!