Code covered by the BSD License  

Highlights from
Complex Roots Finder

4.75

4.8 | 5 ratings Rate this file 9 Downloads (last 30 days) File Size: 2.43 KB File ID: #10357
image thumbnail

Complex Roots Finder

by Marco Cococcioni

 

15 Mar 2006 (Updated 28 Mar 2006)

Computes the n n-th complex roots of a given complex number

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
25 Mar 2006 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])

28 Mar 2006 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.

03 Apr 2006 Mario Rossi

Simple but didactically very useful!

05 Sep 2007 sdfs ssf

good

27 Feb 2008 Chris O´Fork

really nice for eduactional purposes!

Please login to add a comment or rating.
Updates
28 Mar 2006

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

Tag Activity for this File
Tag Applied By Date/Time
linear algebra Marco Cococcioni 22 Oct 2008 08:18:37
nth Marco Cococcioni 22 Oct 2008 08:18:37
roots Marco Cococcioni 22 Oct 2008 08:18:37
complex number Marco Cococcioni 22 Oct 2008 08:18:37
mathematics Marco Cococcioni 22 Oct 2008 08:18:37

Contact us at files@mathworks.com