Iterating over Columns/Rows (no index)

4 visualizaciones (últimos 30 días)
Jan Kager
Jan Kager el 21 de Nov. de 2021
Editada: Yongjian Feng el 21 de Nov. de 2021
Standard way to iterate over matrix columns or rows is to use an incrementing iterator and index the matrix from there.
Are there alternative ways to do this?
Similar to iterating over vector values, like this:
for value = some_vector
...
end

Respuestas (1)

Yongjian Feng
Yongjian Feng el 21 de Nov. de 2021
Editada: Yongjian Feng el 21 de Nov. de 2021
If the array is a row vector, then it works
a = [1 2 3]
for i = a
disp(i)
end

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by