putting a threshold into array values
조회 수: 23 (최근 30일)
이전 댓글 표시
I have an array like this:
and I would like to create a function that as an output would return smaller array, with a given threshold for 2nd column so for example I could put threshold 0.1, and based on this screenshot as I return I'd have:
result = [15 0.2249; 49 0.1674; 50 0.5343]
P.S I wouldn't mind to change format into table,
thanks in advance
댓글 수: 0
채택된 답변
SALAH ALRABEEI
2021년 6월 5일
편집: SALAH ALRABEEI
2021년 6월 5일
Assume your matrix is A, and b is the threshold
% code
B= A(A(:,2)>b,:);
댓글 수: 0
추가 답변 (1개)
Sulaymon Eshkabilov
2021년 6월 5일
Use this logical indexing operation:
OUT = result_Hygepdf((result_Hygepdf(:,2)>0.1), 2);
댓글 수: 0
참고 항목
카테고리
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!