Indexing through an array
조회 수: 1 (최근 30일)
이전 댓글 표시
Suppose I have this
B = [1 4 7 10; 2 5 8 11;3 6 9 12]
1 4 7 10
2 5 8 11
3 6 9 12
And I want to check through each column for a value of 2. How would I do this?
댓글 수: 1
James Tursa
2021년 3월 3일
What do you want as a result? A logical array indicating which columns have a 2 in them? An outline for a for-loop that checks for a 2 in a column? Or ...?
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!