mesh plotting with eqn

조회 수: 1 (최근 30일)
AngelsaAtWar
AngelsaAtWar 2013년 4월 6일
I am trying to plot this code as a mesh plot but it keeps on giving me an error for the mesh(x,y,z) line everytime I try it. with ranges -1<=x<=1 and -2*pi <=y<=2*pi with the eqn : exp(x+i*y)
xd=linspace(-1,1);
yd=linspace(-2*pi ,2*pi);
[x,y]=meshgrid(xd,yd);
u= x+1i.*y;
z= exp(u);
mesh(x,y,z)
can someone help me out please

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 6일
You are taking exp() of a variety of complex numbers. Some of the results you are going to get are going to be complex numbers. mesh() cannot be used on complex results.
You may wish to investigate real() imag() abs()
  댓글 수: 1
AngelsaAtWar
AngelsaAtWar 2013년 4월 6일
i tested it out and the real function worked the best for the graph.Thank you very much, I do appreciate it.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by