[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: newbie - matrix fill from vectors
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: newbie - matrix fill from vectors |
Date: |
Fri, 4 Nov 2011 14:10:33 -0400 |
On 4 November 2011 13:57, Adam Majewski <address@hidden> wrote:
> I was trying to do make vectorised ( fast) code like in this image :
> http://commons.wikimedia.org/wiki/File:Mandelbrot_Creation_Animation_%28800x600%29.gif
>
>
> I have made :
> http://commons.wikimedia.org/wiki/File:Golden_Mean_Quadratic_Siegel_Disc_Speed.png
> Can I vectorise this code ?
Since you have to do an iterated function system for a fractal, you
basically have to run your IFS on each value of the domain. For this
purpose, you would probably do something like
fractal = arrayfun(@ifs, xx, yy)
where ifs(x,y) returns the number of iterations at [x,y].
You should be able to do a variation of this if instead of counting
iterations of the IFS you want to see where it's sending values. But
arrayfun should be the function to use. It's not really "vectorised";
it simply delegates the loop to C++, but it should be enough for this
problem.
- Jordi G. H.