필터 지우기
필터 지우기

hi, i want to find in a binary random matrice position of columns full of zeros (a column of zeros)..

조회 수: 1 (최근 30일)
is there any function in matlab which retur the position of a column ??

채택된 답변

Stephen23
Stephen23 2016년 1월 11일
You can use all and find to locate columns containing only zeros:
>> X = randi(2,3,23)-1
X =
0 0 0 0 1 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0
1 0 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 1 0 0 1 0 0
0 1 0 1 0 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 1 0
>> find(all(X==0,1))
ans =
3 11 12 23
  댓글 수: 2
loukil sana
loukil sana 2016년 1월 11일
hi thanks for your answer.. i have an other question please. why i can't find the boucle do...while(cond) in matlab? is there any other function to replace it?
Stephen23
Stephen23 2016년 1월 11일
편집: Stephen23 2016년 1월 11일
MATLAB does not have do ... while. Use this:
while cond
....
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by