MATLAB: Z=xy

meshgrid

[x,y]=meshgrid(-6:1:6)
z=x*y
Is not giving the function z=x*y, anybody come across this issues pls?

Best Answer

perhaps you means an element-wise multiplication?
z = x.*y;
what you're doing above is a matrix multiplication from linear algebra.