Matching two matrices by sign
2 ビュー (過去 30 日間)
古いコメントを表示
A=[1,1,-3;2,-1,4];
B=[2,4,-2; 2,-1,-3];
How can I get that the sign of B(2,3) is different than the sign of A(2,3)? i.e. the signs of A and B should be the same. I want to find if I have any observation in B that doesn't match the sign of the respective value in A;
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 8 月 4 日
編集済み: Azzi Abdelmalek
2013 年 8 月 4 日
sign(B(2,3))==sign(A(2,3))
For the whole matrices
A=[1,1,-3;2,-1,4];
B=[2,4,-2; 2,-1,-3];
[ii,jj]=find(sign(A)==sign(B))
1 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!