MATLAB: How to plot 3D surface using surf [y*(3x^2+y^2)] / (x^2+y^2)^2

surf

I have used the following command .
[X,Y] = meshgrid(1:0.5:10,1:20);
Z =(Y*((3*(X.^2) + Y.^2) )/((X.^2 + Y.^2).^2));
surf(X,Y,Z)
This is the error which I am getting
Error using *
Inner matrix dimensions must agree.
Error in Mse302 (line 2)
Z =(Y*((3*(X.^2) + Y.^2) )/((X.^2 + Y.^2).^2));

Best Answer

Z = (Y .* ((3*(X.^2) + Y.^2) ) ./ ((X.^2 + Y.^2).^2));
Related Question