Plotting complex functions with the Symbolic Math Toolbox

조회 수: 12 (최근 30일)
Adriano
Adriano 2011년 10월 13일
댓글: Christopher Creutzig 2014년 3월 31일
How should i plot this function : z^(1/n) [ complex roots of z ] with ezsurf(), ezmesh(), ... ? In the official documentation is clearly stated that ezsurf() and ezsurfc() for example, do not accept complex inputs. I understand the trick is probably in using both real() and imag() functions, but even so, i can't get rid of the problem.
Also, i tried with :
>> syms x y n
>> z = x + i * y;
>> fz = z^(1/n);
>> ezsurf(simplify(real(fz)), simplify(imag(fz)))
And that's what i get from Matlab :
??? Undefined function or variable "h".
Error in ==> ezgraph3 at 66
hh = h;
Error in ==> ezsurf at 65
h = ezgraph3('surf',args{:});
Error in ==> sym.ezsurf at 60
ezsurf(char(f),varargin{:});
  댓글 수: 1
Christopher Creutzig
Christopher Creutzig 2014년 3월 31일
What do you want to plot, exactly? Perhaps an animation which shows, for varying n, where the z are such that z^n=z0 for some fixed z0?
The code you posted has two problems:
  1. You cannot plot two functions at the same time with ezsurf. Use two ezsurf calls and “hold on” instead.
  2. The input to ezsurf cannot have three variables (x, y, and n). Fix at least one of them.
Also note that z^(1/n) is exactly one complex value (in MATLAB, in SMT, and in many branches of mathematics), not a multi-valued function returning all n-th roots of z.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by