Question: I need a matlab code to solve for this problem. Write a function which outputs the largest-magnitude odd and even numbers in a matrix. You
Write a function which outputs the largest-magnitude odd and even numbers in a matrix. You may assume that the matrix is populated with integers. Start your function code with function (0, E] = Emax(M) where is the largest-magnitude odd number and E is the largest magnitude even number. For example if M = [1 -7 2; -29 -3; 6 3-8): then I 0 = 9, E = -8 Function UN 1 function (0,E] = OEmax (M) 2 3 end 4 Code to call your function 1 M = 19,-13, -10, 7: 2 -16, 20, 15, 3; 3 -8, -7, -13,-56; 4 13, 30, 21, 11); 5 6 (0,E] = Emax (M)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
