Filter löschen
Filter löschen

how can i plot contour

1 Ansicht (letzte 30 Tage)
khaled Abdelghafar
khaled Abdelghafar am 1 Mär. 2022
Kommentiert: Walter Roberson am 1 Mär. 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))

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 1 Mär. 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 Kommentare
khaled Abdelghafar
khaled Abdelghafar am 1 Mär. 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 am 1 Mär. 2022
You do not need to construct x2 and x3 for that contribution.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Contour Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by