MATLAB: Help to plot a Surface plot of: z = y sin x – x cos y

equationgridhomeworkmatlab functionsurface plot

Require help on plotting this suface plot for the fuction:
z = y sin x – x cos y
using a grid of:
-5<x<5 in steps of 0.2
-5<y<5 in steps of 0.2
Any guidance would be much appreciated
Thanks

Best Answer

[X,Y] = meshgrid(-5:.2:5);
Z = Y .* sin(X) - X .* cos(Y);
surf(X,Y,Z)