Use for loop in array
Mostra commenti meno recenti
How to use the for loop in array with a start value of 0?
Risposte (1)
KSSV
il 10 Giu 2019
a = rand(10,1) ;
for i = 1:length(a)
a(i)
end
6 Commenti
hang dong
il 10 Giu 2019
KSSV
il 10 Giu 2019
No..MATLAB does not accept index as zero. It should be positive integer.
hang dong
il 10 Giu 2019
KSSV
il 10 Giu 2019
What is your purpose? Explain your problem.
hang dong
il 10 Giu 2019
KSSV
il 10 Giu 2019
You can get the index of 0 using
idx = find(a==0)
Categorie
Scopri di più su Matrices and Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!