Physics 281 - Computational Physics

Wednesday/Friday Section

Fall 2009

Exercise 1 - Practice with MATLAB

Practice:

i. Evaluate x:

Answer: x = [31; 83; 100]

ii. Evaluate y for t = 0, 2, 4, ... , 10.

Answer: for t = [0 2 4 6 8 10]: y = [0 34 236 798 1912 3770]

Assignment:

Write a MATLAB program to evaluate:

for values of constants A, B, and C that are input by the user. The "t" array for the calculation should be: t = [0 2 4 6 8 10]

The name of the script file should be something like "exercise1.m" so that I will be able to distinguish it from other assignments that you submit to me.

Please write your name in a comment field near the beginning of the script.

Copy your completed program into the directory ~schloerb/ph281/username, where username is your user name. See this link for examples of how to copy a file to this directory.

Go to Ph281 Home

Go to Ph281 Topics