Borrar filtros
Borrar filtros

Can I call this plot as Contour plot?

1 visualización (últimos 30 días)
Raviteja
Raviteja el 19 de Mzo. de 2011
Hello all,
Refer to the code below
clear all;
x=sin(2*pi*1000*((0:0.1:200)/10000));
y=cos(2*pi*1000*((0:0.1:200)/10000));
figure
plot(x,y)
xlabel ('Values of Sine');
ylabel('Values of Cos');
Can I call the plot I obtain as "Contour plot of x & y" ? What plot it is exactly?

Respuesta aceptada

Matt Tearle
Matt Tearle el 19 de Mzo. de 2011
What you're doing is called a parametric plot - x(t) against y(t) for a parameter variable t.
  5 comentarios
Jiro Doke
Jiro Doke el 20 de Mzo. de 2011
Have you looked at the documentation for "contour"? It has a couple of examples.
http://www.mathworks.com/help/matlab/ref/contour.html
Matt Tearle
Matt Tearle el 20 de Mzo. de 2011
Ok, so x^2 + 2y^2 = 5 is an equation for an ellipse. Two ways to plot this in MATLAB:
Parametrically
t = linspace(0,2*pi);
x = cos(t)*sqrt(5);
y = sin(t)*sqrt(5/2);
plot(x,y)
Using contours
[x,y] = meshgrid(linspace(-2.5,2.5));
z = x.^2 + 2*y.^2;
contour(x,y,z,[5 5])

Iniciar sesión para comentar.

Más respuestas (1)

Sean de Wolski
Sean de Wolski el 19 de Mzo. de 2011
Sure:
%your stuff followed by:
title('Contour plot of x & y');
  1 comentario
Matt Tearle
Matt Tearle el 19 de Mzo. de 2011
::rimshot:: Thank you, you've been great. Don't forget to tip your waiter.

Iniciar sesión para comentar.

Categorías

Más información sobre Contour 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