If you have not already done so, create a directory for this lab and copy the lab 6 files into it. If you start off in your home directory you can do the following:
mkdir ~/cs371/lab6 cd ~/cs371/lab6 cp ~cs371/lab6/* .and (as always) don't forget to type that last period.
[x,a] = gausspoints(n);The two variables on the left-hand side indicate that gausspoints will return two vectors when called. The first output variable will be a vector of the nodes, and the second output variable will be a vector of the weights. For example, if your program does
[x,a] = gausspoints(2);then the variable x will be set to the vector
x = [ -0.7746 0.0000 0.7746 ]and the variable a will be set to the vector
a = [ 0.5556 0.8889 0.5556 ]as indicated in the table on page 213 of your book.
You should look through the code of gausspoints.m and make sure you understand what it's doing.
Call the first program prob1.m and the second program prob2.m.
~cs371/submit lab6to submit your prob1.m and prob2.m files.
If you call them something else then submit won't find them.
This Week's Questions