find position of a element in a matrix

Illustration
Shrishti - 2020-07-17T12:32:57+00:00
Question: find position of a element in a matrix

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.

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

find(A < 7,1,'last')


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!