Indexing of an array

조회 수: 1 (최근 30일)
galben
galben 2022년 10월 20일
댓글: galben 2022년 10월 22일
I have a result array of 50 x 50 and i would like to extract all information for when a certain column equal a certain result.
  댓글 수: 1
David Hill
David Hill 2022년 10월 20일
Hard to understand what you are asking. A simple example would be beneficial.

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

채택된 답변

Matt J
Matt J 2022년 10월 20일
편집: Matt J 2022년 10월 20일
Simplified example:
array=randi(10,5)
array = 5×5
10 10 7 2 4 4 7 10 7 10 1 8 4 2 7 3 7 10 5 5 9 7 10 10 2
test=array(:,5)>4;
subset=array(test,:) %rows where 5th column is greater than 4
subset = 3×5
4 7 10 7 10 1 8 4 2 7 3 7 10 5 5
  댓글 수: 1
galben
galben 2022년 10월 22일
thanks this worked well

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by