Asked by Samadrita
on 28 Jun 2013

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

Answer by Matt J
on 28 Jun 2013

Accepted answer

[i,j,k] = ind2sub(size(A), find(A==B));

NumberUnchanged=length(i);

Show 1 older comment

Samadrita
on 28 Jun 2013

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments