File Exchange

image thumbnail

Complex Roots Finder

version 1.0.0.0 (2.43 KB) by Marco Cococcioni
Computes the n n-th complex roots of a given complex number

3 Downloads

Updated 28 Mar 2006

View License

This very simple function computes the n n-th roots of a given complex number. The attained complex roots can be plotted on a polar diagram.
It is more performante then
roots([1, zeros(1,n-1), -x]),
since it is based on very simple geometric properties of complex roots.

Cite As

Marco Cococcioni (2020). Complex Roots Finder (https://www.mathworks.com/matlabcentral/fileexchange/10357-complex-roots-finder), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Chris O´Fork

really nice for eduactional purposes!

sdfs ssf

good

Mario Rossi

Simple but didactically very useful!

John D'Errico

Fixed now, using angle.m for the phase angle. Error checking, good help. Its faster than the roots solution. If you want only the roots, then no plot is generated, but the plot can be of value for educational purposes.

John D'Errico

This crashes when I run it, lacking the function phase.m. I searched the MathWorks site, but no phase.m is found. Regardless, there is already an existing matlab function that returns phase angle: angle.m.

Help for rootsc is good, with an example, but there is no error checking at all on the parameters.

Of course, if all you really wish to do is find the n n'th roots of x, the one-liner below will work very nicely:

roots([1, zeros(1,n-1), -x])

Updates

1.0.0.0

- function PHASE replaced with ANGLE
- inputs check added
- another example added

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux