MATLAB: Hi, I was wondering if I can compare two matrix based on whether they hold positive or negative numbers, regardless of the number.

MATLABmatrix comparision

For example [1 -1 9] is similar to [4 -0.99 1]

Best Answer

You can do things like this,
A=[1 -1 9];
B=[4 -0.99 1];
same = isequal(sign(A),sign(B))