Question: Below is the user defined function matrixMax created as an example in the textbook Chapter 6 ( pages 1 1 1 to 1 1 5
Below is the user defined function matrixMax created as an example in the textbook Chapter
pages to This function finds the largest number in a matrix without using the builtin
function max.
function biggie matrixMaxA
user defined function matrixMax
finds the largest number in a matrix without using the builtin
function max
Variables
biggie A;
rows sizeA;
columns sizeA;
Walking the Matrix
for r :rows
for c :columns
if Arc biggie is Arc the largest yet?
biggie Arc;
end
end
end
end
Using good programming practices modify the matrixMax function so that it returns the
minimum value in a matrix and also returns the row and column of the minimum matrix values
as a x row vector. Rename the function as martrixMin. Use the randi function to generate
your test matrix. Submit your solution using the Moodle User Defined Functions with Scripts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
