How to plot level curves

조회 수: 11 (최근 30일)
Irene Zhou
Irene Zhou 2020년 11월 23일
I have an equation Z = exp(-0.5.*((X-800)./40).^2).*cos(2*pi.*Y*1000./X).
I want to plot level curves of Y from -100 to 100 against X from 700 to 900 for Z = -1 to 1. The graph is supposed to look like the one below.
I have tried surf but it's ignoring the axis limits I set. I also don't know how to set Z to different values.
[X,Y] = meshgrid(700:1:900,-100:1:100);
Z = exp(-0.5.*((X-800)./40).^2)*cos(2*pi.*Y*1000./X);
surf(Z)
Any help is appreciated!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by