Question: Write a MATLAB function that takes a matrix as an input and returns a vector that contains the number of rows and columns in the

Write a MATLAB function that takes a matrix as an input and returns a vector that contains the number of rows and columns in the matrix. Additionally, the function should print these values (number of rows, number of columns) to the screen. You may not use the function size(). Add comments to each line explaining what the code does.

Write a second MATLAB function that performs the same task as above, but in two steps 1) using the function size() and 2) using the method from your above function. The new function should print the results of both methods to the screen. Hint: Specify more than one output in the function declaration, e.g., function [output1, output2] = matrixSize(inputMatrix).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!