Use for loop in array
Ältere Kommentare anzeigen
How to use the for loop in array with a start value of 0?
Antworten (1)
KSSV
am 10 Jun. 2019
a = rand(10,1) ;
for i = 1:length(a)
a(i)
end
6 Kommentare
hang dong
am 10 Jun. 2019
KSSV
am 10 Jun. 2019
No..MATLAB does not accept index as zero. It should be positive integer.
hang dong
am 10 Jun. 2019
KSSV
am 10 Jun. 2019
What is your purpose? Explain your problem.
hang dong
am 10 Jun. 2019
KSSV
am 10 Jun. 2019
You can get the index of 0 using
idx = find(a==0)
Kategorien
Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!