Cody

Solution 117544

Submitted on 23 Jul 2012 by Khaled Hamed
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))
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.087640787095409 + 0.129736501170973i -0.307444065049497 - 0.012881124046973i -0.055469272764007 + 0.040387848837015i -0.012966936218016 + 0.135156913051460i -0.098840966958943 - 0.177271244572020i -0.456740787015691 + 0.151100284691973i
3   Pass
%% 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.482366301646683 0.200592468690197 -0.177180341684120 0.314173128447107 -0.157149051729915 0.345215715407258