Question: MATLAB In a script file (sc2) , write a general code to generate two m x n positive integer matrices with no elements larger than
MATLAB In a script file (sc2), write a general code to generate two m x n positive integer matrices with no elements larger than 10, matrix A and matrix B. Then the code will merge these two matrices to compute matrix C = [A B]. Use a function file (fu2)that has three inputs (A,B,C) and five scaler outputs (P1,P2,P3,P4,P5) that will go back to the script file to be printed on the screen in a professional way:
P1: the summation of odd numbers in matrix C
P2: the summation of even numbers in matrix C
P3: the number of elements that equal 10 in matrix C
P4: which row of matrix C that has the maximum summation of its elements
P5: How many elements in matrix A that equals to their corresponding elements in matrix B
Run the code for m = n = 20 and write down the results.
P1 =
P2 =
P3 =
P4 =
P5 =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
