How can I use the subplot, meshgrid, surf, and contour functions together?

I need to create a script that uses the subplot, meshgrid, surf and contour functions to generate a 3D surface plot and a contour plot of the function z = (y + 5)^(2) + 1.5*x^(2) − x^(2)*y for −4 ≤ x ≤ 4 and −4 ≤ y ≤ 4 using a step size of 0.1.

Respuestas (1)

These are all sounding like homework.
Follow the same setup I showed before for creating the x, y, z data with meshgrid. Then use surfc() instead of surf() and contour() independently.

Categorías

Más información sobre Contour Plots en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Preguntada:

el 4 de Jul. de 2018

Abierta de nuevo:

el 5 de Jul. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by