function simpleRoots for finding a roots of polynome
Version 0.9.1 (3.27 KB) by
Peter Krammer
Function simpleRoots() effectively finds a roots of polynome in form [a a a ... a] or [a 0 0 ... 0 0 b] also for very large polynome.
Function simpleRoots() finds a roots of polynomial input. Function works very effective for polynomes in form [a 0 0 0 0 0 ... 0 0 0 b] or [a a a a .... a a a a], also for very large polynomes ( approx 30 000 coefficients ).
For polynome with 3000 or more coefficients, it is more than 500-times faster than standard roots() function (for specific form of polynomes).
Function also solves a 2 specific situations:
- removing irrelevant starting zeros in polynome (simpleRoots([0 a b c]) -> simpleRoots([a b c]))
- solving a roots, which are located in zero point (simpleRoots([a b c 0 0]) -> [0.0; 0.0; SimpleRoots([a b c]) ] )
For polynomes, which are not in specific form, this function calls standard roots() function.
Example script (which demonstrate a speed-up in compare with roots() function ) is also attached (scriptRoots.m).
Cite As
Peter Krammer (2024). function simpleRoots for finding a roots of polynome (https://www.mathworks.com/matlabcentral/fileexchange/134177-function-simpleroots-for-finding-a-roots-of-polynome), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2023a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
0.9.1 |