Wednesday, May 1, 2013

Matlab Day 1

Wednesday we started learning how to use Matlab (which stands for matrix laboratory as I learned from Wikipedia). I had done some programming in high school (I don't remember what it was called, Basic or something, I don't know). This was actually a pretty interesting class. We got through the first four chapters in class -the author of the text book made the reading easy and fun. 


 Here we just plugged in the program to find the nth Fibonacci number




Here we have a script with cars moving from lot A to lot B and vise versa. Intially we had a 'a' where there is currently a 'c'. This did not work because it was getting confused with the new and old value. Here 'c' is the updated value of 'a'



Then we graphed it, putting the script in loop. A is the red circles and B is the blue diamonds.

Then we moved back to the Fibonacci sequence, making it recursive instead of using an equation- so apply what we learned in the car exercise.


then we graphed it



No comments:

Post a Comment