5. Exercises - Arduinerd/PDS-MatLab GitHub Wiki

The best way to learn a new language is through examples. Try to do the following in order to practice what is outlined in this tutorial.

  1. Print "Hello World!" from a function named test
  2. Create five different variables with each belonging to one of the following types: number, constant, logical, String, and function handle (HINT: You already have defined a function named test)
  3. Put all five values from #2 into a cell array
  4. You have a bank account with initial balance P and rate r. Make a graph that shows the TOTAL amount accumulated over 10 years.
  5. Properly format the chart from #4 with a green line (because money is green), x-axis title, y-axis title, and chart title
  6. Create a function for a nxn matrix that contains only perfect squares
  7. Create a function for a nxnxn matrix that contains only perfect cubes
  8. Make a class for a student who has a name and age in addition to a method that changes their age and sets their year in high school. If they are older than high school age they are "too old" and if they are younger they are "too young"
  9. In the command window, make a structure of a teacher who has a name, age, department, and student list (HINT: A list is sometimes used as another name for an array)

Challenge Balance the given chemical equation: HIO3 + FeI2 + HCl → FeCl3 + ICl + H2O.
(HINT: Set up equations for the elements and use linear algebra to solve)