Problem 81. Mandelbrot Numbers
z(1) = c
z(n+1) = z(n)^2 + c
For any complex c, we can continue this iteration until either abs(z(n+1)) > 2 or n == lim, then return the iteration count n.
- If c = 0 and lim = 3, then z = [0 0 0] and n = 3.
- If c = 1 and lim = 5, then z = [1 2], and n = length(z) or 2.
- If c = 0.5 and lim = 5, then z = [0.5000 0.7500 1.0625 1.6289] and n = 4.
For a matrix of complex numbers C, return a corresponding matrix N such that each element of N is the iteration count n for each complex number c in the matrix C, subject to the iteration count limit of lim.
If C = [0 0.5; 1 4] and lim = 5, then N = [5 4; 2 1]
Solution Stats
Problem Comments
-
8 Comments
Show
5 older comments
Shlomo Geva
on 28 Nov 2020
Broken ink to Cleve Moler's PDF
goc3
on 30 Nov 2020
Thanks for noticing that, @Shlomo Geva. The link has been fixed.
Andreas
on 17 Jul 2023
Really nice problem, and great very simple solution by the community.
Solution Comments
Show commentsGroup

M3 Challenge Problem Group
- 20 Problems
- 21 Finishers
- Add two numbers
- Return area of square
- Make the vector [1 2 3 4 5 6 7 8 9 10]
- Calculate Amount of Cake Frosting
- Sum all integers from 1 to 2^n
- Reverse the vector
- Magic is simple (for beginners)
- Solve a System of Linear Equations
- Roll the Dice!
- Chess probability
- Throwing Dice - Will You Be Eaten By The Dragon?
- The Birthday Phenomenon
- Fibonacci sequence
- Monte-Carlo integration
- Make a Plot with Functions
- Differential equations I
- Numerical Integration
- Create initial basic feasible solution for transportation problems - North-West Corner Method
- Create initial basic feasible solution for transportation problems -Minimum Cost Method
- There are 10 types of people in the world
Problem Recent Solvers1752
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!