To familiarize our selves, we read through the first four chapters Allen Downey's Physical Modeling in MATLAB and did some assigned exercises.
Here, n represents the nth element of the fibonacci sequence.
We first simplified the problem for ourselves like this:
The textbook knew we would think in this way! It informed us that we did not account for all the cars being transferred. Below is the correct code:

This problem taught us how to use a for loop. The loop runs 52 times to show the number of cars in each location at the end of the year.
Here, we learned how to make plots. We added three new lines to our loop:










No comments:
Post a Comment