if (cond1) - PowerPoint PPT Presentation

1 / 1
About This Presentation
Title:

if (cond1)

Description:

Write a function that creates a movie of a random walk that starts in the center of a 50x50 grid and progresses in unit steps chosen randomly from left, right, up and ... – PowerPoint PPT presentation

Number of Views:8
Avg rating:3.0/5.0
Slides: 2
Provided by: EricG203
Category:
Tags: cond1 | walk

less

Transcript and Presenter's Notes

Title: if (cond1)


1
Write a function that creates a movie of a random
walk that starts in the center of a 50x50 grid
and progresses in unit steps chosen randomly from
left, right, up and down gtgt walkMovie
randomWalk(300) gtgt movie(walkMovie, 4, 12)
rand(1) returns a single random number in the
range from 0 to 1 getframe takes a snapshot of
the contents of the current figure window reuse
x1,y1,x2,y2 to plot each new segment
function myMovie randomWalk (steps) figure axis(
0 50 0 50) axis equal hold on x1 25 y1
25 myMovie
(x2, y2)
1
  • if (cond1)
  • elseif (cond2)
  • else
  • end

(x1, y1)
Write a Comment
User Comments (0)
About PowerShow.com