Newton Fractal - Basin of Attraction
Version 1.0.0 (1.64 KB) by
Owais Ali
Explore fractals made by Newton's method.
the code is set and you just have to run the script, nothing else.
to get a fractal for some different function, one have to make the following changes:
- function 'f' and the first derivative 'f1' of the function.
- note that we are dealing with martix input, therefore, it is necessary to use element wise multiplication, division and exponenciation (.* ./ and .^), instead of regular multiplication, division and exponenciation (* / and ^)
- the information of roots must be updated, and assigned to r1, r2, ... so on.
- the logical matrices must set accordingly, each for a root and one in negation of each logical matrix (see script).
- the colour-map must be updated and the number of colours will be one greater than the number of roots, obviously one extra colour for divergence (black usually [0 0 0]).
- update the Z matrix which is the sum of every logical matrix multiplied by the row number of the colour-map, to assign a colour to it.
in the file, some lines are commented (starting with a % sign) to show how to make the aforementioned changes. now you have it and i'll ask you to go wild with it
Cite As
Owais Ali (2025). Newton Fractal - Basin of Attraction (https://www.mathworks.com/matlabcentral/fileexchange/109940-newton-fractal-basin-of-attraction), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2018b
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 | |
---|---|---|---|
1.0.0 |