Skip to Main Content
Programming in MATLAB ®: A Problem-Solving Approach by Pearson
book

Programming in MATLAB ®: A Problem-Solving Approach by Pearson

by Ram N. Patel, Ankush Mittal
May 2024
Intermediate to advanced content levelIntermediate to advanced
433 pages
13h 7m
English
Pearson India
Content preview from Programming in MATLAB ®: A Problem-Solving Approach by Pearson
268 Ñ Efficient Coding Using Vectorization Technique
Solution
This is a simple problem to illustrate the use of FIND function. FIND(MARKS>=90)
would provide the indices of all elements that have values greater than 90. Then we can
print the first value as the output.
>> MARK = [30 19 91 20 78 88 45 10 28 19 45 10 92 78];
>> y = find(MARK >= 90)
y =
3 13
>>y(1)
ans = 3
Example 9.9
An array M is a n-by-2 dimensional array, where the first column
stores the roll numbers of students and the second column stores
their percentage marks. The task is to find the roll numbers of
all students who have more than 90 marks. Test your code with
M = [201 57; 202 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied Numerical Methods Using MATLAB, 2nd Edition

Applied Numerical Methods Using MATLAB, 2nd Edition

Won Y. Yang, Wenwu Cao, Jaekwon Kim, Kyung W. Park, Ho-Hyun Park, Jingon Joung, Jong-Suk Ro, Han L. Lee, Cheol-Ho Hong, Taeho Im
MATLAB Recipes: A Problem-Solution Approach

MATLAB Recipes: A Problem-Solution Approach

Michael Paluszek, Stephanie Thomas
Practical MATLAB Deep Learning: A Projects-Based Approach

Practical MATLAB Deep Learning: A Projects-Based Approach

Michael Paluszek, Stephanie Thomas, Eric Ham

Publisher Resources

ISBN: 9781306983440Publisher Website