Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 165281

Submitted on 20 Nov 2012 by @bmtran

Correct

32Size
Leading solution size is 22.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
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))
v =
  2.000000000000000
 -0.023200000000000 - 0.777600000000000i
  0.020900000000000 - 0.810000000000000i
  0.327600000000000
  0.125000000000000 + 0.156250000000000i
  0.312500000000000
v =
  2.000000000000000
 -0.384123520000000 - 0.503919360000000i
 -0.405663190000000 - 0.573858000000000i
  0.367321760000000
  0.116210937500000 + 0.164062500000000i
  0.347656250000000
v =
  2.000000000000000
  0.113616157234381 - 0.152865443281305i
  0.085249619556976 - 0.074413866225960i
  0.394925275369498
  0.111588478088379 + 0.163131713867188i
  0.370864868164062
v =
  2.000000000000000
  0.209540787435118 - 0.574735968479104i
  0.251730074147914 - 0.552687507571054i
  0.415965973125674
  0.110840032372835 + 0.161407239356777i
  0.387540750438347
v =
  2.000000000000000
 -0.066414091864685 - 0.780861254804793i
  0.007904549205411 - 0.818256134522974i
  0.433027690798389
  0.111233215859635 + 0.160780767271030i
  0.400187833250317
v =
  2.000000000000000
 -0.385333467657105 - 0.436279617779643i
 -0.419480619786339 - 0.552935891755932i
  0.447512980998185
  0.111522373186215 + 0.160768323583873i
  0.410150301881584
v =
  2.000000000000000
  0.178141976406698 - 0.203773724025708i
  0.120225889984403 - 0.076108218848219i
  0.460267868161882
  0.111590785853117 + 0.160858529958486i
  0.418223270133554
v =
  2.000000000000000
  0.210210833154779 - 0.612601307875385i
  0.258661803646293 - 0.558300356692310i
  0.471846510462283
  0.111577036826911 + 0.160900659538489i
  0.424910703681204
v =
  2.000000000000000
 -0.111091768035006 - 0.797550862640384i
  0.005206640382793 - 0.828821954476804i
  0.482639129435434
  0.111560412907153 + 0.160905637629601i
  0.430549106102856
v =
  2.000000000000000
 -0.403745997573277 - 0.362797329142871i
 -0.436918723118673 - 0.548630755716649i
  0.492940529262193
  0.111555101507026 + 0.160901398746094i
  0.435372532765968
v =
  2.000000000000000
  0.251388928523241 - 0.247044060856582i
  0.139902264493430 - 0.060585901497298i
  0.502990365389291
  0.111555280553793 + 0.160898743739486i
  0.439549242287054
v =
  2.000000000000000
  0.222165625379552 - 0.664208283513533i
  0.265901992150149 - 0.556952209631696i
  0.512999307674453
  0.111556174882491 + 0.160898208997223i
  0.443203536395123
v =
  2.000000000000000
 -0.171815078787706 - 0.835128497378126i
  0.010508105615790 - 0.836189404146991i
  0.523168289674468
  0.111556546495899 + 0.160898377482347i
  0.446429374673144
v =
  2.000000000000000
 -0.447919185834221 - 0.253024662850237i
 -0.449102299324067 - 0.557573533147162i
  0.533705059320908
  0.111556575189640 + 0.160898534657448i
  0.449299186571054
v =
  2.000000000000000
  0.356610117027915 - 0.313330798040287i
  0.140804630391955 - 0.039184888442731i
  0.544841090344734
  0.111556531013128 + 0.160898578958833i
  0.451869759053411
v =
  2.000000000000000
  0.248994586566100 - 0.763473865115193i
  0.268290488457546 - 0.551034827468258i
  0.556851813728038
  0.111556506900711 + 0.160898574627178i
  0.454186279146988
v =
  2.000000000000000
 -0.300894038574710 - 0.920201718796760i
  0.018340405113816 - 0.835674806037157i
  0.570083942452206
  0.111556502914831 + 0.160898565901423i
  0.456285176165385
v =
  2.000000000000000
 -0.536233980826713 + 0.013766422944293i
 -0.448016010985500 - 0.570653228972262i
  0.584995701441850
  0.111556504833452 + 0.160898562671948i
  0.458196161988277
v =
  2.000000000000000
  0.507357367792582 - 0.554764047554325i
  0.125073238362891 - 0.028676433399703i
  0.602219970705442
  0.111556506300757 + 0.160898562568817i
  0.459943722860787
v =
  2.000000000000000
  0.169648350194561 - 1.102927253826242i
  0.264820977122053 - 0.547173308779997i
  0.622668893116464
  0.111556506661319 + 0.160898563017982i
  0.461548228199041
v =
  2.000000000000000
 -0.967667964508959 - 0.914219577992479i
  0.020731520082629 - 0.829805940572451i
  0.647716550454882
  0.111556506597225 + 0.160898563234224i
  0.463026766953674
v =
  2.000000000000000
  0.320583852752167 + 1.229321996300444i
 -0.438148103084394 - 0.574406277043324i
  0.679536729733172
  0.111556506513339 + 0.160898563261846i
  0.464393786915572
v =
  2.000000000000000
 -1.188458563942685 + 0.248201563693962i
  0.112031189129681 - 0.036649958627397i
  0.721770167056454
  0.111556506485734 + 0.160898563241014i
  0.465661589325785
v =
  2.000000000000000
  1.570829741988580 - 1.129954547912110i
  0.261207767870420 - 0.548211876893162i
  0.780952174052702
  0.111556506486279 + 0.160898563227483i
  0.466840715773416
v =
  2.000000000000000
  1.410708797968648 - 4.089932421911207i
  0.017693236029124 - 0.826394401366633i
  0.869886298157641
  0.111556506490755 + 0.160898563224639i
  0.467940253903836
v =
  2.000000000000000
-14.517447903134325 -12.079407301374722i
 -0.432614656008933 - 0.569243182393053i
  1.016702171722404
  0.111556506492669 + 0.160898563225445i
  0.468968081223586
v =
   1.0e+02 *
  0.020000000000000
  0.650642128677143 + 3.501843323968958i
  0.001131176398928 - 0.000474741129272i
  0.012936833059851
  0.001115565064928 + 0.001608985632262i
  0.004699310612065
v =
   1.0e+05 *
  0.000020000000000
 -1.183954948601644 + 0.455683958920201i
  0.000002605418091 - 0.000005507403192i
  0.000019336164962
  0.000001115565065 + 0.000001608985632i
  0.000004708352023
v =
   1.0e+10 *
  0.000000000200000
  1.194101449923133 - 1.079018556377920i
  0.000000000001457 - 0.000000000082698i
  0.000000000399887
  0.000000000011156 + 0.000000000016090i
  0.000000000047169
v =
   1.0e+20 *
  0.000000000000000
  0.261597227700640 - 2.576915245329681i
 -0.000000000000000 - 0.000000000000000i
  0.000000000000000
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
   1.0e+40 *
  0.000000000000000
 -6.572059072071868 - 1.348227768395516i
  0.000000000000000 - 0.000000000000000i
  0.000000000000000
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
   1.0e+81 *
  0.000000000000000
  4.137424233132939 + 1.772126507300593i
  0.000000000000000 - 0.000000000000000i
  0.000000000000000
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
  1.0e+163 *
  0.000000000000000
  1.397784692703829 + 1.466407831096542i
  0.000000000000000 - 0.000000000000000i
  0.000000000000000
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
   1.0e+19 *
  0.000000000000000
               -Inf +               Infi
 -0.000000000000000 - 0.000000000000000i
  2.385061473843367
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
   1.0e+38 *
  0.000000000000000
               -Inf -               Infi
  0.000000000000000 - 0.000000000000000i
  5.688518234011893
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
   1.0e+77 *
  0.000000000000000
               -Inf +               Infi
  0.000000000000000 - 0.000000000000000i
  3.235923969868578
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
  1.0e+155 *
  0.000000000000000
               -Inf -               Infi
  0.000000000000000 - 0.000000000000000i
  1.047120393877002
  0.000000000000000 + 0.000000000000000i
  0.000000000000000
v =
  2.000000000000000
               -Inf +               Infi
 -0.439644705765294 - 0.564303909773558i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.477554965937176
v =
  2.000000000000000
               -Inf -               Infi
  0.124848564721729 - 0.043813547250798i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.478058745491257
v =
  2.000000000000000
               -Inf +               Infi
  0.263667537190378 - 0.550940116979259i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.478540164140674
v =
  2.000000000000000
               -Inf -               Infi
  0.015985557670919 - 0.830530047566600i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.479000688695783
v =
  2.000000000000000
               -Inf +               Infi
 -0.439524621856929 - 0.566552971945614i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.479441659771035
v =
  2.000000000000000
               -Inf -               Infi
  0.122199623198068 - 0.041972038487370i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.479864305124005
v =
  2.000000000000000
               -Inf +               Infi
  0.263171095894965 - 0.550257934576023i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.480269751332144
v =
  2.000000000000000
               -Inf -               Infi
  0.016475231150686 - 0.829623967334543i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.480659034044639
v =
  2.000000000000000
               -Inf +               Infi
 -0.438004493934439 - 0.567336493259971i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.481033107008726
v =
  2.000000000000000
               -Inf -               Infi
  0.119977240122242 - 0.043008132758254i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.481392850038468
v =
  2.000000000000000
               -Inf +               Infi
  0.262544838663999 - 0.550319994142293i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.481739076068159
v =
  2.000000000000000
               -Inf -               Infi
  0.016077696356332 - 0.828967348151322i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.482072537411004
v =
  2.000000000000000
               -Inf +               Infi
 -0.436928371980908 - 0.566655770625782i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.482393931325883
v =
  2.000000000000000
               -Inf -               Infi
  0.119807639858388 - 0.044824033333780i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.482703904980041
v =
  2.000000000000000
               -Inf +               Infi
  0.262344676604129 - 0.550740523285308i
                Inf
  0.111556506492491 + 0.160898563226396i
  0.483003059882981
v =
  2.000000000000000
               -Inf -               Infi
  0.015509605353950 - 0.828967688948146i
                Inf
  0.11...
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.294715874499896 + 0.023362475820525i
 -0.209454253263440 + 0.083075331936627i
 -0.209139434255236 - 0.150094585969624i
 -0.298081349302648 + 0.152478505952209i
 -0.274043597406987 - 0.140569938677523i
 -0.012857532338506 - 0.234721246923454i
v =
 -0.208404233094122 + 0.009591890836668i
 -0.172484679829676 + 0.048274368705830i
 -0.187928516032029 - 0.087313192380702i
 -0.232478553277979 + 0.061576508364436i
 -0.218703611787027 - 0.063525355312587i
 -0.067786279957972 - 0.228685374877749i
v =
 -0.251375554498170 + 0.019364494513049i
 -0.182033703161441 + 0.066422153876218i
 -0.181445900680945 - 0.117277308621375i
 -0.247826737950782 + 0.123848070791262i
 -0.230247798365887 - 0.112783489383689i
 -0.060559553270942 - 0.203717785235941i
v =
 -0.231901188748380 + 0.013626954728937i
 -0.180729886702329 + 0.058893190652533i
 -0.189970786498790 - 0.107535612185139i
 -0.252001601898040 + 0.091092779180817i
 -0.233749664232209 - 0.088633638432290i
 -0.050691008867567 - 0.210047130788986i
v =
 -0.241123407052169 + 0.017042261819204i
 -0.180259369221239 + 0.061787812588285i
 -0.184614442420300 - 0.109237336322745i
 -0.242874436362355 + 0.106567453402389i
 -0.227260613740062 - 0.099133772231070i
 -0.054407751111180 - 0.213426244984592i
v =
 -0.236865815759365 + 0.015143899353082i
 -0.180778546855846 + 0.060799667691178i
 -0.186989737551966 - 0.109761006096220i
 -0.250449979588987 + 0.100713485592856i
 -0.232223715646239 - 0.095511534838322i
 -0.055448091005753 - 0.211497162888024i
v =
 -0.238839797512163 + 0.016188331672434i
 -0.180469969851487 + 0.061092780787568i
 -0.186221750764737 - 0.109046222522880i
 -0.245499363206787 + 0.102031125130076i
 -0.229238196585614 - 0.096209851663062i
 -0.054514091452007 - 0.211267019052907i
v =
 -0.237933487706582 + 0.015629640103117i
 -0.180617171109602 + 0.061024507322876i
 -0.186351972443862 - 0.109481029024640i
 -0.248221762463020 + 0.102381353458798i
 -0.230749782190191 - 0.096459992899503i
 -0.054519499511170 - 0.211687187728568i
v =
 -0.238347815577431 + 0.015924846257859i
 -0.180555681257805 + 0.061031184174597i
 -0.186398472337812 - 0.109290574561773i
 -0.246949247478456 + 0.101651945954425i
 -0.230102665656338 - 0.096053693974268i
 -0.054696621959988 - 0.211639087867677i
v =
 -0.238159794037700 + 0.015771171182591i
 -0.180578704670724 + 0.061036277863397i
 -0.186339473453408 - 0.109351393691151i
 -0.247430536588794 + 0.102272762835878i
 -0.230322672790936 - 0.096365516618289i
 -0.054656915398135 - 0.211569360561345i
v =
 -0.238244516844287 + 0.015850358059367i
 -0.180571011898301 + 0.061031627947638i
 -0.186374762190540 - 0.109341623726013i
 -0.247319196884113 + 0.101867696778410i
 -0.230281376598536 - 0.096179611972716i
 -0.054631748266003 - 0.211593789641377i
v =
 -0.238206658544139 + 0.015809954025200i
 -0.180573222535403 + 0.061034246304016i
 -0.186359472952697 - 0.109337547730698i
 -0.247291591802184 + 0.102090832040868i
 -0.230264602758092 - 0.096273191785943i
 -0.054644836234705 - 0.211601769622780i
v =
 -0.238223416971412 + 0.015830403180367i
 -0.180572743788519 + 0.061033030856356i
 -0.186364280439792 - 0.109342410431558i
 -0.247350755913387 + 0.101986097224618i
 -0.230290337580298 - 0.096233322151835i
 -0.054646783118880 - 0.211595358827433i
v =
 -0.238216079771214 + 0.015820130345201i
 -0.180572768319639 + 0.061033528249704i
 -0.186363551950378 - 0.109339546686365i
 -0.247300116878833 + 0.102025829469878i
 -0.230270810116518 - 0.096246730187884i
 -0.054643857310574 - 0.211595235557846i
v =
 -0.238219250362470 + 0.015825256955918i
 -0.180572820175430 + 0.061033345623899i
 -0.186363197229255 - 0.109340773391394i
 -0.247333271373380 + 0.102016506847088i
 -0.230282384487128 - 0.096244313614663i
 -0.054644124907508 - 0.211596487204614i
v =
 -0.238217902014360 + 0.015822714122861i
 -0.180572779155378 + 0.061033405248529i
 -0.186363597699554 - 0.109340393736145i
 -0.247314969843672 + 0.102014353207059i
 -0.230276588705067 - 0.096243198612500i
 -0.054644625348931 - 0.211596237169857i
v =
 -0.238218463941987 + 0.015823968295484i
 -0.180572801247774 + 0.061033388722541i
 -0.186363365410090 - 0.109340447668517i
 -0.247323583254127 + 0.102019152578158i
 -0.230279043380509 - 0.096244827752422i
 -0.054644464843423 - 0.211596052712674i
v =
 -0.238218235909633 + 0.015823352978892i
 -0.180572791251929 + 0.061033391994080i
 -0.186363463784613 - 0.109340478363723i
 -0.247320301961753 + 0.102015021199850i
 -0.230278226455838 - 0.096243604947224i
 -0.054644404324066 - 0.211596140796525i
v =
 -0.238218325079493 + 0.015823653354911i
 -0.180572795261231 + 0.061033392032739i
 -0.186363433830245 - 0.109340445410164i
 -0.247321082090601 + 0.102017734256646i
 -0.230278367320578 - 0.096244325367597i
 -0.054644448214557 - 0.211596156781260i
v =
 -0.238218292101714 + 0.015823507422834i
 -0.180572793818008 + 0.061033391529375i
 -0.186363437788729 - 0.109340464243291i
 -0.247321249759042 + 0.102016233094639i
 -0.230278441116620 - 0.096243966458482i
 -0.054644450182432 - 0.211596136460189i
v =
 -0.238218303195200 + 0.015823577993873i
 -0.180572794277777 + 0.061033391887332i
 -0.186363440431741 - 0.109340456358034i
 -0.247320860535094 + 0.102016941422858i
 -0.230278338043548 - 0.096244117551644i
 -0.054644441367645 - 0.211596137848267i
v =
 -0.238218300143225 + 0.015823544020171i
 -0.180572794155428 + 0.061033391701935i
 -0.186363437722264 - 0.109340458719105i
 -0.247321197584104 + 0.102016670468491i
 -0.230278414598183 - 0.096244067805002i
 -0.054644442918427 - 0.211596141426915i
v =
 -0.238218300522127 + 0.015823560303072i
 -0.180572794176983 + 0.061033391783825i
 -0.186363439248480 - 0.109340458431581i
 -0.247320975581690 + 0.102016735724589i
 -0.230278369764788 - 0.096244075980291i
 -0.054644444263400 - 0.211596140379530i
v =
 -0.238218300856911 + 0.015823552533311i
 -0.180572794179195 + 0.061033391751620i
 -0.186363438616742 - 0.109340458204994i
 -0.247321098707870 + 0.102016748742080i
 -0.230278391986758 - 0.096244080845003i
 -0.054644443673164 - 0.211596139924815i
v =
 -0.238218300451517 + 0.015823556224515i
 -0.180572794174465 + 0.061033391762981i
 -0.186363438802658 - 0.109340458427598i
 -0.247321040460485 + 0.102016717181218i
 -0.230278382688679 - 0.096244074327061i
 -0.054644443545238 - 0.211596140224294i
v =
 -0.238218300761477 + 0.015823554478720i
 -0.180572794177560 + 0.061033391759455i
 -0.186363438782041 - 0.109340458303972i
 -0.247321062832624 + 0.102016744676966i
 -0.230278385716346 - 0.096244079118714i
 -0.054644443685956 - 0.211596140245701i
v =
 -0.238218300558552 + 0.015823555300671i
 -0.180572794176012 + 0.061033391760350i
 -0.186363438762691 - 0.109340458354559i
 -0.247321057376475 + 0.102016726511746i
 -0.230278385244270 - 0.096244076329096i
 -0.054644443679637 - 0.211596140183811i
v =
 -0.238218300681245 + 0.015823554915485i
 -0.180572794176680 + 0.061033391760216i
 -0.186363438780966 - 0.109340458339935i
 -0.247321056369003 + 0.102016736610266i
 -0.230278384924719 - 0.096244077704742i
 -0.054644443654136 - 0.211596140193249i
v =
 -0.238218300610600 + 0.015823555095119i
 -0.180572794176422 + 0.061033391760183i
 -0.186363438770956 - 0.109340458341390i
 -0.247321058927777 + 0.102016731820671i
 -0.230278385336686 - 0.096244077132689i
 -0.054644443660917 - 0.211596140203009i
v =
 -0.238218300649943 + 0.015823555011771i
 -0.180572794176512 + 0.061033391760226i
 -0.186363438775005 - 0.109340458343036i
 -0.247321056684862 + 0.102016733667731i
 -0.230278385036838 - 0.096244077316853i
 -0.054644443664306 - 0.211596140199073i
v =
 -0.238218300628560 + 0.015823555050236i
 -0.180572794176485 + 0.061033391760200i
 -0.186363438773856 - 0.109340458341537i
 -0.247321058171164 + 0.102016733211727i
 -0.230278385210385 - 0.096244077289752i
 -0.054644443662270 - 0.211596140198069i
v =
 -0.238218300639965 + 0.015823555032586i
 -0.180572794176491 + 0.061033391760213i
 -0.186363438773957 - 0.109340458342347i
 -0.247321057342936 + 0.102016733134030i
 -0.230278385125240 - 0.096244077268828i
 -0.054644443662068 - 0.211596140199040i
v =
 -0.238218300633973 + 0.015823555040634i
 -0.180572794176490 + 0.061033391760207i
 -0.186363438774096 - 0.109340458342023i
 -0.247321057736760 + 0.102016733341448i
 -0.230278385160426 - 0.096244077294854i
 -0.054644443662501 - 0.211596140199020i
v =
 -0.238218300637082 + 0.015823555036989i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438773973 - 0.109340458342113i
 -0.247321057584279 + 0.102016733158497i
 -0.230278385149231 - 0.096244077276095i
 -0.054644443662445 - 0.211596140198838i
v =
 -0.238218300635486 + 0.015823555038627i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438774039 - 0.109340458342107i
 -0.247321057622374 + 0.102016733280104i
 -0.230278385150776 - 0.096244077286889i
 -0.054644443662374 - 0.211596140198882i
v =
 -0.238218300636298 + 0.015823555037898i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438774013 - 0.109340458342095i
 -0.247321057628342 + 0.102016733212179i
 -0.230278385152142 - 0.096244077281620i
 -0.054644443662401 - 0.211596140198907i
v =
 -0.238218300635888 + 0.015823555038220i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438774020 - 0.109340458342105i
 -0.247321057611531 + 0.102016733244560i
 -0.230278385150499 - 0.096244077283784i
 -0.054644443662408 - 0.211596140198893i
v =
 -0.238218300636094 + 0.015823555038079i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438774020 - 0.109340458342100i
 -0.247321057626454 + 0.102016733231973i
 -0.230278385151672 - 0.096244077283104i
 -0.054644443662402 - 0.211596140198892i
v =
 -0.238218300635991 + 0.015823555038140i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438774019 - 0.109340458342102i
 -0.247321057616504 + 0.102016733235155i
 -0.230278385151001 - 0.096244077283191i
 -0.054644443662402 - 0.211596140198895i
v =
 -0.238218300636042 + 0.015823555038114i
 -0.180572794176490 + 0.061033391760209i
 -0.186363438774019 - 0.109340458342101i
 -0.247321057622075 + 0.102016733235611i
 -0.230278385151327 - 0.096244077283280i
 -0.054644443662403 - 0.211596140198894i...
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.246769906521507
   0.242413120310728
   0.428119755528687
  -0.105792129131657
  -0.139181748394534
   0.193031757042761
v =
  -0.185874519756874
   0.301177241209511
   0.611406280602630
  -0.094600154545448
  -0.119810189308375
   0.230293016269776
v =
  -0.212220569426658
   0.333120850933300
   0.801937395489029
  -0.096842939891634
  -0.124827266932426
   0.246066630385392
v =
  -0.201732336433732
   0.353382621637254
   1.071223341812414
  -0.096413574124802
  -0.123599901824715
   0.253580543631982
v =
  -0.206073970958495
   0.367292397585946
   1.575639203572442
  -0.096496551856138
  -0.123904812663455
   0.257334849151452
v =
  -0.204303425014904
   0.377316825635161
   2.910758655363086
  -0.096480544611532
  -0.123829345793368
   0.259252981630562
v =
  -0.205030017048686
   0.384781107218122
   8.900635705299806
  -0.096483633643119
  -0.123848041514921
   0.260243865527097
v =
  -0.204732598630522
   0.390469620782732
  79.649435713986449
  -0.096483037570677
  -0.123843411007453
   0.260758626587247
v =
   1.0e+03 *
  -0.000204854469580
   0.000394879645065
   6.344460729311988
  -0.000096483152593
  -0.000123844557945
   0.000261026818382
v =
   1.0e+07 *
  -0.000000020480455
   0.000000039834305
   4.025218237390177
  -0.000000009648313
  -0.000000012384427
   0.000000026116676
v =
   1.0e+15 *
  -0.000000000000000
   0.000000000000000
   1.620238185861848
  -0.000000000000000
  -0.000000000000000
   0.000000000000000
v =
   1.0e+30 *
  -0.000000000000000
   0.000000000000000
   2.625171778924893
  -0.000000000000000
  -0.000000000000000
   0.000000000000000
v =
   1.0e+60 *
  -0.000000000000000
   0.000000000000000
   6.891526868863687
  -0.000000000000000
  -0.000000000000000
   0.000000000000000
v =
  1.0e+121 *
  -0.000000000000000
   0.000000000000000
   4.749314258427013
  -0.000000000000000
  -0.000000000000000
   0.000000000000000
v =
  1.0e+243 *
  -0.000000000000000
   0.000000000000000
   2.255598592529814
  -0.000000000000000
  -0.000000000000000
   0.000000000000000
v =
  -0.204818990877815
   0.408583552547544
                 Inf
  -0.096483133987404
  -0.123844330244563
   0.261316672351604
v =
  -0.204819087497300
   0.409353639723099
                 Inf
  -0.096483133987625
  -0.123844330260810
   0.261318160291677
v =
  -0.204819047918280
   0.409983522665277
                 Inf
  -0.096483133987583
  -0.123844330256786
   0.261318937940987
v =
  -0.204819064131356
   0.410499609167758
                 Inf
  -0.096483133987591
  -0.123844330257783
   0.261319344369366
v =
  -0.204819057489862
   0.410923049437610
                 Inf
  -0.096483133987589
  -0.123844330257536
   0.261319556784396
v =
  -0.204819060210471
   0.411270872869832
                 Inf
  -0.096483133987590
  -0.123844330257597
   0.261319667800754
v =
  -0.204819059096006
   0.411556851181841
                 Inf
  -0.096483133987590
  -0.123844330257582
   0.261319725822257
v =
  -0.204819059552534
   0.411792162065440
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319756146581
v =
  -0.204819059365523
   0.411985905049258
                 Inf
  -0.096483133987590
  -0.123844330257584
   0.261319771995269
v =
  -0.204819059442129
   0.412145506269984
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319780278420
v =
  -0.204819059410748
   0.412277038649269
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319784607523
v =
  -0.204819059423603
   0.412385476908139
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319786870083
v =
  -0.204819059418337
   0.412474901875481
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319788052586
v =
  -0.204819059420494
   0.412548664987916
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319788670610
v =
  -0.204819059419611
   0.412609521294039
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319788993613
v =
  -0.204819059419973
   0.412659737373224
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789162427
v =
  -0.204819059419825
   0.412701179159666
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789250656
v =
  -0.204819059419885
   0.412735383590507
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789296768
v =
  -0.204819059419860
   0.412763617178331
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789320868
v =
  -0.204819059419871
   0.412786923976868
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789333464
v =
  -0.204819059419866
   0.412806164917012
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789340047
v =
  -0.204819059419868
   0.412822050104219
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789343487
v =
  -0.204819059419867
   0.412835165362979
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789345285
v =
  -0.204819059419868
   0.412845994071006
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789346225
v =
  -0.204819059419868
   0.412854935131205
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789346716
v =
  -0.204819059419868
   0.412862317772919
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789346973
v =
  -0.204819059419868
   0.412868413747555
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347107
v =
  -0.204819059419868
   0.412873447381150
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347177
v =
  -0.204819059419868
   0.412877603863123
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347214
v =
  -0.204819059419868
   0.412881036082482
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347233
v =
  -0.204819059419868
   0.412883870267272
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347243
v =
  -0.204819059419868
   0.412886210637609
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347248
v =
  -0.204819059419868
   0.412888143245412
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347251
v =
  -0.204819059419868
   0.412889739143372
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347253
v =
  -0.204819059419868
   0.412891057000610
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347253
v =
  -0.204819059419868
   0.412892145261809
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412893043929626
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412893786036200
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412894398858035
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412894904919066
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412895322818853
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412895667916413
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412895952894868
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896188227689
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896382563683
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896543044904
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896675569160
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896785006792
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896875379673
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412896950009025
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897011637483
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897062529892
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897104556541
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897139261903
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897167921392
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897191588234
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897211132179
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897227271459
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897240599187
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897251605151
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   0.412897260693815
                 Inf
  -0.096483133987590
  -0.123844330257585
   0.261319789347254
v =
  -0.204819059419868
   ...