Matlab assume you are given two matrices m1 and m2 both


Matlab: assume you are given two matrices M1 and M2, both with the same dimensions. Using nested for loops, write a function named MatComp that will return a matrix D with the same dimensions as M1 and M2 with each element containing either 1,0,or -1 based on the contents of M1 and M2 as described below For all r and c within the matrix size: -If M1(r,c)=M2(r,c), then D(r,c)=0 -If M1(r,c)-M2(r,c)>0 , then D(r,c)=1 If M1(r,c)-M2(r,c)<0, thenD(r,c)=-1 If the matrices passed to the function are not the same size, an error message should appear on the screen and an empty matrix be returned for D(D=[ ] will establish D as an empty matrix).

Request for Solution File

Ask an Expert for Answer!!
Other Subject: Matlab assume you are given two matrices m1 and m2 both
Reference No:- TGS0651572

Expected delivery within 24 Hours