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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started