Cody

Solution 1806180

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   Fail
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 1 1 1 1 1

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

2   Pass
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.163182208348440 + 0.018834080845408i -0.457860757721189 - 0.087784127692824i -0.332214498429683 - 0.008959014436508i -0.496862104855275 + 0.095544022215154i -0.321586479324163 + 0.092562071675596i -0.305684661344470 - 0.004559717104671i tf = 6×1 logical array 1 1 1 1 1 1

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.506164049687144 0.232750897616199 0.434693382202488 -0.033903838979882 0.046609721608371 0.165790268578174 tf = 6×1 logical array 1 1 1 1 1 1

0.506164 0.232751 0.434693 -0.033904 0.046610 0.165790 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 1.000000