How to plot a surface in an easy way

1 visualización (últimos 30 días)
Daniel
Daniel el 7 de Jul. de 2013
Hi guys! I have a function LSQDiff which takes a vector argument x that consists of two values x(1) and x(2) and returns a vector of differences.
I want to take a squared norm of this vector and plot it for different values of x(1) and different values x(2)
I have vector a for different values of x(1) and vector b for x(2);
How can I plot a surface with this?

Respuestas (1)

the cyclist
the cyclist el 7 de Jul. de 2013
Here is a simple example of using the surf() command to plot a surface.
a = 1:10;
b = 1:7;
[aa,bb] = meshgrid(a,b);
z = aa + bb.^2;
surf(aa,bb,z)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by