Cody

Problem 81. Mandelbrot Numbers

Solution 2615107

Submitted on 26 Jun 2020 by 春樹 内糸
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
C = 0; lim = 5; N_correct = 5; assert(isequal(mandelbrot(C,lim),N_correct))

N = 0 r = 1 c = 1 n = 1 z = 0 z = 0 n = 2 z = 0 n = 3 z = 0 n = 4 z = 0 n = 5 N = 5

2   Pass
C = [0 0.5; 1 4]; lim = 5; N_correct = [5 4; 2 1]; assert(isequal(mandelbrot(C,lim),N_correct))

N = 0 0.5000 1.0000 4.0000 r = 2 c = 2 n = 1 z = 0 z = 0 n = 2 z = 0 n = 3 z = 0 n = 4 z = 0 n = 5 N = 5.0000 0.5000 1.0000 4.0000 n = 1 z = 0.5000 z = 0.7500 n = 2 z = 1.0625 n = 3 z = 1.6289 n = 4 z = 3.1533 N = 5 4 1 4 n = 1 z = 1 z = 2 n = 2 z = 5 N = 5 4 2 4 n = 1 z = 4 z = 20 N = 5 4 2 1

3   Pass
i = sqrt(-1); C = [i 1 -2*i -2]; lim = 10; N_correct = [10 2 1 10]; assert(isequal(mandelbrot(C,lim),N_correct))

N = 0.0000 + 1.0000i 1.0000 + 0.0000i 0.0000 - 2.0000i -2.0000 + 0.0000i r = 1 c = 4 n = 1 z = 0.0000 + 1.0000i z = -1.0000 + 1.0000i n = 2 z = 0.0000 - 1.0000i n = 3 z = -1.0000 + 1.0000i n = 4 z = 0.0000 - 1.0000i n = 5 z = -1.0000 + 1.0000i n = 6 z = 0.0000 - 1.0000i n = 7 z = -1.0000 + 1.0000i n = 8 z = 0.0000 - 1.0000i n = 9 z = -1.0000 + 1.0000i n = 10 N = 10.0000 + 0.0000i 1.0000 + 0.0000i 0.0000 - 2.0000i -2.0000 + 0.0000i n = 1 z = 1 z = 2 n = 2 z = 5 N = 10.0000 + 0.0000i 2.0000 + 0.0000i 0.0000 - 2.0000i -2.0000 + 0.0000i n = 1 z = 0.0000 - 2.0000i z = -4.0000 - 2.0000i N = 10 2 1 -2 n = 1 z = -2 z = 2 n = 2 z = 2 n = 3 z = 2 n = 4 z = 2 n = 5 z = 2 n = 6 z = 2 n = 7 z = 2 n = 8 z = 2 n = 9 z = 2 n = 10 N = 10 2 1 10

Community Treasure Hunt

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

Start Hunting!