How to do: "for each value of the vector A"
134 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all,
i'd like to know how is possible to get the iteration for each element of a vector. I show an example.
A=[14 5 7 3 8];
for i=each element of A
etc
end
Thanks to all will answer me.
0 comentarios
Respuestas (1)
madhan ravi
el 14 de Sept. de 2019
for ii = 1:numel(A) % this is for illustration purposes
A(ii)
end
4 comentarios
Stephen23
el 15 de Sept. de 2019
Note that in most real-world code, looping over indices (as per madhan ravi's original answer), is much more useful.
Robin Amar
el 23 de Dic. de 2021
This operation is straight forward in Python as well.
Ver también
Categorías
Más información sobre Subplots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!