- You cannot plot two functions at the same time with ezsurf. Use two ezsurf calls and “hold on” instead.
- The input to ezsurf cannot have three variables (x, y, and n). Fix at least one of them.
Plotting complex functions with the Symbolic Math Toolbox
9 views (last 30 days)
Show older comments
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 Comment
Christopher Creutzig
on 31 Mar 2014
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:
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.
Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!