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

3 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Walter Roberson
Walter Roberson il 4 Lug 2018
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.

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by