Cody

Problem 81. Mandelbrot Numbers

Solution 342705

Submitted on 30 Oct 2013 by John
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))

ans = 2 ans = 3 ans = 4 ans = 5

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

ans = 2 2 2 1 ans = 3 3 2 1 ans = 4 4 2 1 ans = 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))

ans = 2 2 1 2 ans = 3 2 1 3 ans = 4 2 1 4 ans = 5 2 1 5 ans = 6 2 1 6 ans = 7 2 1 7 ans = 8 2 1 8 ans = 9 2 1 9 ans = 10 2 1 10