MATLAB: How to plot a 3D graph for Z=5*X*Y*(1-X-Y)

3d3d plots

How can I plot a 3D graph for Z=5*X*Y*(1-X-Y)? I've tried a few different programs I saw online but couldn't get any to work so far. X and Y don't have a specific range but if it helps we can define them as 0:10.

Best Answer

Try this:
[X,Y] = meshgrid(linspace(0, 10, 25));
Z = 5*X.*Y.*(1-X-Y);
figure(1)
surf(X, Y, Z)
grid on
view(40, 40)
Related Question