MATLAB: Whats the error in the surface plot? How to correct it

surfaceplot

[x y]=meshgrid(13:120,1:12);
igx1=((x.*y.^3)/12)+(x.*y).*((((x.*y).*(150-(y./2))+113664+6000)/((x.*y)+1536+1200))-(150-(y./2))).^2;
igx2=2097152+1536.*((((x.*y)*(150-(y./2))+113664+6000)/((x.*y)+1536+1200))-74).^2;
igx3=10000+1200.*((((x.*y)*(150-(y./2))+113664+6000)/((x.*y)+1536+1200))-5).^2;
[z]=igx1+igx2+igx3;
surf(x,y,z)
Capture.PNG

Best Answer

Use dots after * and / (element wise operation):
[x y]=meshgrid(13:120,1:12);
igx1=((x.*y.^3)/12)+(x.*y).*((((x.*y).*(150-(y./2))+113664+6000)./((x.*y)+1536+1200))-(150-(y./2))).^2;
igx2=2097152+1536.*((((x.*y).*(150-(y./2))+113664+6000)./((x.*y)+1536+1200))-74).^2;
igx3=10000+1200.*((((x.*y).*(150-(y./2))+113664+6000)./((x.*y)+1536+1200))-5).^2;
z=igx1+igx2+igx3;
surf(x,y,z)
Screen Shot 2018-12-06 at 3.13.38 PM.png