Cody

Solution 485038

Submitted on 9 Aug 2014 by rifat
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))

ans = 1 0 1 0 1 1

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.094434655802117 - 0.183784479752064i -0.460007829366468 + 0.218490730102985i -0.125219731902440 - 0.189884769926228i -0.278258588915918 - 0.064600815475675i -0.029377683346738 - 0.220769322926015i -0.090869689923694 - 0.205216760020121i ans = 1 1 1 1 1 1

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.322706376476329 0.578654740597024 -0.167374524294814 0.647011483907542 0.196626612751654 0.263403193933990 ans = 0 0 1 0 1 0