matrix=[1 0 0 1 0;0 1 0 1 0];
% I need to find the number of column includes [1;1]
index_1 = 4 ;
% how can I find this using code or function?

 채택된 답변

madhan ravi
madhan ravi 2024년 1월 6일

0 개 추천

index = find(all(matrix)) % one can directly use logical indexing without find() function

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2024년 1월 6일

답변:

2024년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by