Cody

Solution 1806211

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.465630815066970 - 0.220526698699076i -0.292835732471851 + 0.072407135232742i -0.005431607746932 + 0.248707668429626i -0.286317155917297 + 0.223418402602996i -0.264884598779912 + 0.108310114077913i -0.099758817726376 - 0.013515735161525i 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.547545942140820 -0.115539703605959 -0.044685047358023 0.396867225191668 0.540496817474271 -0.011126076675027 tf = 6×1 logical array 1 0 1 0 1 1

0.547546 -0.115540 -0.044685 0.396867 0.540497 -0.011126 1.000000 0.000000 1.000000 0.000000 1.000000 1.000000 0.000000 1.000000 1.000000 0.000000 0.000000 1.000000