Hi
i want to plot the following contour but i always encounter an error
x=-pi:0.001*pi:pi;
y=0:0.1*6:6;
[x,y]=meshgrid(x,y);
z=(100*sqrt(2*pi)/sqrt(2*pi.*(y-2.))).*cos(x/2).*(1.-sin(x/2.).*sin(3.*x/2.));
contour(x,y,z)

댓글 수: 1

Abolfazl Chaman Motlagh
Abolfazl Chaman Motlagh 2022년 2월 28일
become imaginary for . so one of conceptional error are there. the z become complex. the other one is in Arif solution. should use dot before / .

댓글을 달려면 로그인하십시오.

 채택된 답변

Arif Hoq
Arif Hoq 2022년 2월 28일
편집: Arif Hoq 2022년 2월 28일

0 개 추천

you shoud demontrate element wise multiplication/division in the variable z. most porbably this contour is allowed to plot real value.
x=-pi:0.001*pi:pi;
y=0:0.1*6:6;
[x,y]=meshgrid(x,y);
z=(100*sqrt(2*pi)./sqrt(2*pi.*(y-2))).*cos(x./2).*(1-sin(x./2).*sin(3*x./2));
% contour(x,y,z)
contour(real(z))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by