How I equate the arrangement of elements two matrices???
2 ビュー (過去 30 日間)
古いコメントを表示
I have two matrices with the same size 5x5, the element of the two matrices is 0 and 1 but arrange of the element is different, and now i want to equate the element of the two matrices, arrangement of elements in matrices B must same with arrangement of elements in matrices A , without eliminate the elements in matrices B


If you know the way please help me....
2 件のコメント
Walter Roberson
2018 年 6 月 24 日
What would the expected answer be?
At first I thought perhaps you were asking for the permutation matrix between the two, but we can see that B is not a permutation of A, because A has both rows and columns that are all 1's but B has no rows or columns that are all 1's.
回答 (2 件)
Walter Roberson
2018 年 6 月 24 日
[R, C] = find(A == B);
5 件のコメント
Image Analyst
2018 年 6 月 24 日
"i expected B same with A eventhough not all it's element....." I hope you can see that this makes no sense whatsoever. If it's the same, all elements match. If all elements don't match, it's not the same.
Image Analyst
2018 年 6 月 24 日
Why can't you simply do
B = A;
This will make the "arrangement of elements in matrices B must same with arrangement of elements in matrices A" just like you asked for.
5 件のコメント
参考
カテゴリ
Help Center および File Exchange で Condensed Matter & Materials Physics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!