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

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 10일
편집: Azzi Abdelmalek 2013년 5월 10일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

질문:

2013년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by