






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























Dr. Muhammad Hanif Durad
Department of Computer and Information SciencesPakistan Institute Engineering and Applied Sciences
Most of the codes have been adopted from various books forNumerical Computing using MATLAB their references have beengiven in short on each topic
docsity.com
Dr. Hanif Durad
Lecture Outline (1/2)
docsity.com
Example: Data Fitting (Slides)
Refer EMSE, P-
P-
Dr. Hanif Durad
docsity.com
Example: Data Fitting (book-1/2)
A=[1.
0
0;1.
0.2500;
1.0000;1.
2.2500;
4.0000;1.
6.2500;
9.0000; 1.
12.2500;
16.0000;1.
20.2500;
25.0000;1.
30.2500;
36.0000; 1.
42.2500;
49.0000; 1.
56.2500;
64.0000;1.
72.2500;
81.0000; 1.
10.0000 100.0000]
Dr. Hanif Durad
docsity.com
MATLAB beauty
Dr. Hanif Durad
docsity.com
Normal Equations (1/2)>>A=[1 0 0;0 1 0;0 0 1;-1 1 0;-1 0 1;0 -1 1];
Dr. Hanif Durad
docsity.com
Normal Equations function
format long>> [x,dist] = lsqne(A,b)x =
1.0e+003 *
1.2360000000000001.9430000000000002.
dist =
Dr. Hanif Durad
err = A'(b - Ax)err =
1.0e-012 *-0.
0.6821210263296960.
Tutorial 4, P-
docsity.com
Dr. Hanif Durad
Dr. Hanif Durad
Condition Number
Dr. Hanif Durad
docsity.com
Householder Example (2/2)
Dr. Hanif Durad
docsity.com
Householder QR Factorization(1/4)
P1 = Houspre(u, A)
P1 =
-1.
0
0
0
0
0
-0.
0
-0.
0
-1.
Dr. Hanif Durad
Example 3.8, P-
A=[1 0 0;0 1 0;0 0 1;-1 1 0;-1 0 1;0 -1 1];b=[1237 1941 2417 711 1177 475]';>> u = Housv(A(:,1))u =
0 0
-0.3251-0.
Tutorial 4, P-
→
7
docsity.com
Householder QR Factorization(3/4)
v2(1,1)=0v2 =
0
0
-0.2113-1.
Dr. Hanif Durad
Example 3.8, P-
u = Housv(v2)u =
0.70710.
0
-0.0915-0.
docsity.com
Householder QR Factorization-Assignment (3/4)^
Dr. Hanif Durad
docsity.com