find position of a element in a matrix

S
Shrishti · Jul 17, 2020 · 2K views
Question
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 PhD Expert
Answered Aug 28, 2026
find(A < 7,1,'last')
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!