how to pick out postion in a vector

Hey guys, I have a vector a= [ 1,0,8,0,5,0,3,0,6,9] I want to run a for loop like this for p=1:length(a) if a ==0 spit out where in vector a the zeros are located end end Thanks

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 10 Mai 2013
Bearbeitet: Azzi Abdelmalek am 10 Mai 2013

0 Stimmen

a= [ 1,0,8,0,5,0,3,0,6,9]
idx=find(~a)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 10 Mai 2013

Community Treasure Hunt

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

Start Hunting!

Translated by