Question: IN MATLAB Write a function to accept a matrix m and a number flag, trim and return a matrix as in the following examples. If
IN MATLAB
Write a function to accept a matrix and a number flag, trim and return a matrix as in the following
examples. If is a square matrix, return as is If is not itself square: then return the top square or
the left square when flag ; or return the bottom square or the right square when flag Examples:
Input
and flag would return:
flag left square, trim off the remaining part
Input same as above but flag would return:
as flag not right square
Input
and flag would return:
bottom square as flag not
Hints: might need some careful algebra on the row number and column number.
THIS MUST BE DONE IN MATLAB
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
