Cody

Solution 1806213

Submitted on 5 May 2019
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
format long v=[-2; 0.22-0.54i ; 0.25-.54i ; 0.26 ;.125+.125i; 0.25]; tf=isMandelbrot(v); tf_expected=[1 ; 0 ; 1 ; 0 ; 1 ; 1] ; assert(isequal(tf,tf_expected),sprintf('\n%f %f %f %f %f %f',tf,tf_expected))

tf = 6×1 logical array 1 0 1 0 1 1

2   Fail
v=-.25*ones(6,1)+(rand(6,1)-.5)/2+i*(rand(6,1)-.5)/2 %v=[-.5-.25i;-.5+.25i;-.25i;.25i;-.25-.25i;-.25+.25i] % Bounding Cases tf=isMandelbrot(v); tf_expected=[1 ; 1 ; 1 ; 1 ; 1 ; 1] ; assert(isequal(tf,tf_expected),sprintf('\n%f %f %f %f %f %f',tf,tf_expected))

v = -0.351667144104975 + 0.132058169859987i -0.183551578658347 - 0.113405319329023i -0.113675464573870 - 0.089636980081165i -0.011764014433976 + 0.156719546057536i -0.367750987953381 - 0.248603750542698i -0.174838181647502 + 0.045803483399745i tf = 6×1 logical array 1 0 1 0 1 1

1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000

3   Fail
v=rand(6,1)-0.25 tf=isMandelbrot(v); tf_expected=v<=0.25; % non-imaginary range [-2.0,0.25] assert(isequal(tf,tf_expected),sprintf('\n%f %f %f %f %f %f',v,tf,tf_expected))

v = 0.424322371609420 0.430838492408926 0.731506755333487 -0.024825013989741 -0.016353047941471 0.256153398636721 tf = 6×1 logical array 1 0 1 0 1 1

0.424322 0.430838 0.731507 -0.024825 -0.016353 0.256153 1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000