Save coordinates in an array
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Oliver Lestrange
le 28 Août 2020
Réponse apportée : Walter Roberson
le 28 Août 2020
Hi,
I am itereting two loops, in order to form coordinates.
I am trying to save them with this line, because I want to keep it in an array.
[idx_x, idx_y] = [[idx_x, idx_y] ;[xi, yi] ];
xi and yi are the indexes of the loop.
for yi=1:mapa.ylength
for xi=1:mapa.xlength
if mapa.img(xi,yi,1) == 0
at(xi,yi) = at(xi,yi) + 20;%+ 26;
alturas(xi,yi) = mapa.buildingHeight;
else
alturas(xi,yi) = Movel.Altura;
end
[idx_x, idx_y] = [[idx_x, idx_y] ;[xi, yi] ];
heights = [heights; alturas(xi,yi)];
end
end
How can I do this?
Thanks!
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Collect Coverage for Models dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!