Introduction to MATLAB

Overall, I enjoyed working with MATLAB. At first I did find understanding the programming language slightly challenging; however the more I played around with the various functions, the more comfortable I got with it. Over the course of this assignment, I found coding for graphs the most difficult. Reading Allen Downey’s book on the programming language helped overcome the issues I came across and overall increased my comprehension of the language.

Exercise 2.3: Car Update Script

Precondition: variables ‘a’ and ‘b’ contain the number of cars in each location at the beginning of the week.

Postcondition: ‘a’ and ‘b’ have been modified to reflect the number of cars that moved.

Exercise 3.1: Car Loop Script

Exercise 3.2: Car Loop Script with Plotting

Plot with initial values of a = 150 and b = 150

Plot with inital values of a= 1000 and b= 1000

Exercise 2.1 and 3.5: Fibonacci Sequences and Scripts 

Image shows the program required to find nth term values in the Fibonacci sequence. (Exercise 2.1)

 

Program calculating the Fibonacci sequence continuously

Exercise 4.6: Plotting Fibonacci Ratios

Print Friendly, PDF & Email
One Comment

Leave a Reply