MATLAB: 2D subtraction from 3D

array substraction

I have 3D matrix A=50x60x180 and I want subtract B=50×60 to get same size C=50x50x180? Can anybody use for loop to do this operation?

Best Answer

C = A - B;
or
C = bsxfun(@minus,A,B);
Related Question