Course information
Additional Course Material
- Review of Taylor's theorem with example
- Gaussian elimination WITHOUT pivoting: Download m-file lunp.m
and put it in the same folder as your other m-files.
- Gaussian elimination WITHOUT pivoting ,
Matlab live script file (download this file and open it
with Matlab, then
you can modify and rerun the examples, instructions
for Matlab
Live Scripts)
- Solving linear
systems
- Solving a linear system \(Ax=b\) in Matlab:
[L,U,p] = lu(A,'vector')
y = L\b(p)
x = U\y
or you can use the shortcut x=A\b.
-
Errors for linear
systems
- How to approximate \(\mathrm{cond}_1(A)\) , \(\mathrm{cond}_\infty(A)\) just using
\(L,U\):
\(\mathrm{cond}_1(A)\approx\)
norm(A,1)*invnormest(L,U),
\(\mathrm{cond}_\infty(A)\approx\) norm(A,Inf)*invnormest(U',L').
You first have to download invnormest.m and put it in
the same folder as your other m-files.
Matlab programming
We will use Matlab to see how various algorithms work.
How to hand in Matlab results for homeworks:
- You have to write an m-file for each problem. (Typing commands at the >> prompt and printing this out is not allowed)
- You have to hand in all m-files together with the generated output and graphics.
- You can use the publish command in Matlab
(if you call additional m-files you have to print them out separately).
- You can use Live Scripts and export them as pdf, html
or Word
- You can manually combine code, graphics, output e.g. in Microsoft Word.
- Comment your code so that another person (or you one week later) can see what
you are
doing.
- Only print out values which are asked for in the problem. (Make sure you have a semicolon at the end of lines.)
Label all numerical output and graphics:
How to display and label numerical output and graphics in Matlab
- Hand in additional pages (this can be handwritten) which show the "paper and pencil work",
answer all the questions asked in the problem and describe your observations.
- Each homework has to be handed in as a SINGLE PDF file on
ELMS.
How to use the publish command in Matlab:
Use lines starting with %% for the main title and for each section title.
Lines starting with % right after a section title will be printed at the beginning of each section. Use this for your observations about the problem.
How to use Live Scripts in Matlab