summaryrefslogtreecommitdiff
path: root/2048/CH6/EX6.1/LS_ex.sce
blob: 25b3076d71673a08603c556ee040825a2ea2fee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Least squares solution of the simple problem discussed in Example 6.4 on page 164
// 6.1

Mag = 10; V = 10; No_pts = 100; theta = 2;
Phi = Mag * (1-2*rand(No_pts,1));
E = V * (1-2*rand(No_pts,1));
Z = Phi*theta + E;
LS = Phi \ Z
Max = max(Z ./ Phi), Min = min(Z ./ Phi)