MATLAB: How to get the product multiplication of element matrix with equal size

image processingmatrix manipulation

How to get the product multiplication of element matrix with equal size? I tray with this, but failed
X=pascal(4);
Y=magic(4);
Z(i,j)=X(i,j)*Y(i,j)

Best Answer

Try
X=pascal(4);
Y=magic(4);
Z=X*Y
Z=X.*Y
returns
Z =
34 34 34 34
69 101 101 69
125 217 219 119
206 396 403 185
Z =
16 2 3 13
5 22 30 32
9 21 36 120
4 56 150 20
Related Question