フィルターのクリア

Access difference between 3 dimensional matrices

1 回表示 (過去 30 日間)
Samadrita
Samadrita 2013 年 6 月 28 日
I have two matrices,A is a 1000*1000*3 matrix and B is another matrix that started out as A and due to changes made during the code is a different 1000*10000*3 matrix. I would like to find out the position and the number of elements that have not changed. This for two D matrices can be done with setdiff, is there any way I can do this for 3D matrices? Thanks

採用された回答

Matt J
Matt J 2013 年 6 月 28 日
[i,j,k] = ind2sub(size(A), find(A==B));
NumberUnchanged=length(i);
  4 件のコメント
Samadrita
Samadrita 2013 年 6 月 28 日
Sorry about not mentioning RGB! [i,j] is still a matrix bigger than my original matrix at 25609092x2 . I also tried simply find(all(A==B)),that is a 933X1 matrix. Would that give me the number of unchanged values? Or am I misunderstanding something? Thanks for commenting.
Matt J
Matt J 2013 年 6 月 28 日
[i,j] is still a matrix bigger than my original matrix at 25609092x2
No, I don't think it's bigger
>> 5052*6492>25609092
ans =
1

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by