fern - % 85% of time, f1 computes next pt.t pt. [x y] =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function fern(n) f axis equal off hold on h x = 20*rand-10; % start from an arbitrary (x,y) in interval [-10,10] y = 20*rand-10; y for i = 1:n % iterate through 'n' points num = rand; % num is assigned a random number if num <= 0.85
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % 85% of time, f1 computes next pt.t pt. [x y] = f1(x,y); elseif (num>=0.85)&&(num <= 0.92) [x y] = f2(x,y); elseif (num>=0.92)&&(num <=0.99) [x y] = f3(x,y); else [x y] = f4(x,y); end plot(x,y,'k') end e...
View Full Document

This note was uploaded on 09/12/2009 for the course CS 100 taught by Professor Fan/vanloan during the Fall '07 term at Cornell University (Engineering School).

Ask a homework question - tutors are online