Attachment 'mandelbrot.m'

Download

   1 %
   2 %	Filename: mandelbrot.m
   3 %
   4 function [m]=mandelbrot(edge,x1,x2,y1,y2)
   5 maxloop=64;
   6 maxsize=16;
   7 if edge<1
   8    edge=10;
   9 end
  10 m=zeros(edge);
  11 ystep=(y2-y1)/edge;
  12 xstep=(x2-x1)/edge;
  13 iy=1;
  14 for y=y1:ystep:y2
  15    ix=1;
  16    for x=x1:xstep:x2
  17       mx=x;
  18       my=y;
  19       for i=1:maxloop
  20          realnum=mx*mx;
  21          imagnum=my*my;
  22          if(realnum+imagnum)>maxsize
  23             break
  24          end
  25          my=(mx*my)+y;
  26          mx=(realnum-imagnum)*.5 +x;
  27       end
  28       m(iy,ix)=maxloop-i;
  29       ix=ix+1;
  30    end
  31    iy=iy+1;
  32 end

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-03-18 13:47:34, 0.5 KB) [[attachment:mandelbrot.m]]
  • [get | view] (2013-03-18 13:48:07, 0.2 KB) [[attachment:mandelbrot.sge]]
  • [get | view] (2013-03-18 13:46:56, 0.5 KB) [[attachment:mandelplot.m]]
  • [get | view] (2014-08-27 06:53:16, 0.7 KB) [[attachment:primes.c]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.