FF505/FY505 – Computational Science
Week 9, Spring 2014 [pdf format]

MATLAB Exercises

Work in small groups at the computer to solve the following exercises posted in the slides of lecture 4.

  1. Monte Carlo simulation to calculate π. You are only allowed to use the function randi to generate random numbers. Make your simulation exactly reproducible by setting the random seed to a fixed number.
  2. Function arguments
  3. Techniques for Improving Performance (in particular read the help page listed)
  4. Stochastic matrices