Cody

Problem 785. Mandelbrot Number Test [Real+Imaginary]

Solution 2147254

Submitted on 2 Mar 2020
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))

Undefined function 'isMandelbrot' for input arguments of type 'double'. Error in Test1 (line 4) tf=isMandelbrot(v);

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.233561866009032 - 0.123976204524952i -0.022312246828575 - 0.092751512996731i -0.299131113989026 + 0.143192993751583i -0.478548472446324 - 0.206491910436828i -0.418421094331570 + 0.212045325803605i -0.138423895530265 + 0.119496388580395i

Undefined function 'isMandelbrot' for input arguments of type 'double'. Error in Test2 (line 6) tf=isMandelbrot(v);

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.495663493432587 0.576076549075324 -0.116610070860434 0.717392068806282 -0.159771117740864 0.172687237431006

Undefined function 'isMandelbrot' for input arguments of type 'double'. Error in Test3 (line 2) tf=isMandelbrot(v);