필터 지우기
필터 지우기

find position of a element in a matrix

조회 수: 3 (최근 30일)
NS
NS 2011년 11월 22일
댓글: Farzana Aslam 2022년 1월 11일
Hi Guys,
How do I find the last element in a increasing matrix that is less than a particular number. For example if my matrix is
A=[ 1 2 3 4 6 8 9]
And I want the last number that is less than 7. So I want to find the position of 6 and not any other number like 1,2,3,4.
Thanks, NS
  댓글 수: 2
Ahmed Elgamal
Ahmed Elgamal 2016년 12월 8일
parula.
Farzana Aslam
Farzana Aslam 2022년 1월 11일
how we find position from one matric to the other.

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

채택된 답변

Walter Roberson
Walter Roberson 2011년 11월 22일
find(A < 7,1,'last')
  댓글 수: 3
Mohamed Aly
Mohamed Aly 2019년 6월 3일
How about a certain element in the matrix? not necessarly the last one.
Would the same method applies for a 2D matrix?
Akashkumar Chovatiya
Akashkumar Chovatiya 2020년 7월 17일
How about a certain element in the matrix?

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

추가 답변 (1개)

Honglei Chen
Honglei Chen 2011년 11월 22일
You can use find
find(A<7,1,'last')
HTH
  댓글 수: 2
NS
NS 2011년 11월 22일
thanks :)
Mohamed Aly
Mohamed Aly 2019년 6월 3일
How about a certain element in the matrix? not necessarly the last one.
Would the same method applies for a 2D matrix?

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

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by