How do you preallocate variables for coordinates?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm trying to use ginput in multiple iterations and save the coordinates into variables...for example.
for k = 1:3
[x(i),y(i) = ginput(4);
end
So I would click 4 times for the first iteration, and save those data points into the first variable. Then, I would click 4 times for the next two iterations and save those data points in two more variables
0 Commenti
Risposte (1)
Youssef Khmou
il 10 Mag 2013
hi, you can use cells :
for k=1:3
A{k}=ginput(4);
end
you can later transform it to matrix : " cell2mat"
0 Commenti
Vedere anche
Categorie
Scopri di più su Data Exploration in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!