Borrar filtros
Borrar filtros

how can i plot contour

1 visualización (últimos 30 días)
khaled Abdelghafar
khaled Abdelghafar el 1 de Mzo. de 2022
Comentada: Walter Roberson el 1 de Mzo. de 2022
i encounter an error while trying to plot the following contour
x=0:0.1:4;
x1=-pi:0.001*pi:pi;
y1=(100*sqrt(2*pi)./sqrt(x.*2*pi)).*cos(x1/2).*(1.-sin(x1/2.).*sin(3.*x1/2.));
y2=(100*sqrt(2*pi)./sqrt(x.*2*pi)).*cos(x1/2).*(1.+sin(x1/2.).*sin(3.*x1/2.));
y3=(100*sqrt(2*pi)./sqrt(x.*2*pi)).*cos(x1/2).*sin(x1/2.).*sin(3.*x1/2.);
y4=(1/2).*((y1-y2)^2+y1^2+y2^2+6.*y3^2);
z=abs(sqrt(y4));
[x,x1]=meshgrid(x,x1);
% contour(x,x1,z)
contour(real(z))

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Mzo. de 2022
x = (0:0.1:4).';
x1=-pi:0.001*pi:pi;
y1=(100*sqrt(2*pi)./sqrt(x.*2*pi)).*cos(x1/2).*(1.-sin(x1/2.).*sin(3.*x1/2.));
y2=(100*sqrt(2*pi)./sqrt(x.*2*pi)).*cos(x1/2).*(1.+sin(x1/2.).*sin(3.*x1/2.));
y3=(100*sqrt(2*pi)./sqrt(x.*2*pi)).*cos(x1/2).*sin(x1/2.).*sin(3.*x1/2.);
y4 = (1/2).*((y1-y2).^2+y1.^2+y2.^2+6.*y3);
z = sqrt(y4);
[x,y]=meshgrid(x1,x);
% contour(x,x1,z)
contour(x, y, real(z))
  5 comentarios
khaled Abdelghafar
khaled Abdelghafar el 1 de Mzo. de 2022
i would changed to r and theta
the question how i plot the contour in x,y not r and thata
how could i do it
Walter Roberson
Walter Roberson el 1 de Mzo. de 2022
You do not need to construct x2 and x3 for that contribution.

Iniciar sesión para comentar.

Más respuestas (0)

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