Plotting complex functions with the Symbolic Math Toolbox

11 次查看(过去 30 天)
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
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