Use for loop in array
Mostrar comentarios más antiguos
How to use the for loop in array with a start value of 0?
Respuestas (1)
KSSV
el 10 de Jun. de 2019
a = rand(10,1) ;
for i = 1:length(a)
a(i)
end
6 comentarios
hang dong
el 10 de Jun. de 2019
KSSV
el 10 de Jun. de 2019
No..MATLAB does not accept index as zero. It should be positive integer.
hang dong
el 10 de Jun. de 2019
KSSV
el 10 de Jun. de 2019
What is your purpose? Explain your problem.
hang dong
el 10 de Jun. de 2019
KSSV
el 10 de Jun. de 2019
You can get the index of 0 using
idx = find(a==0)
Categorías
Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!