disp('Surface of the cost for a 3d box') pause clear; disp('Generate the x and y grid matrices') pause [x ,y ] = meshgrid(1:1:20,1:1:20); disp('Calculate the cost matrix c') pause c = 3*x.*y + 2000./y + 2000./x; whos pause disp('Create the surface or contour graphs') pause mesh(x,y,c) %contour(x,y,c,500:50:2000)