File Exchange

image thumbnail

Complex Roots Finder

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


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 (2021). Complex Roots Finder (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Andres Sanchez

Chris O´Fork

really nice for eduactional purposes!

sdfs ssf


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])

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

Community Treasure Hunt

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

Start Hunting!