diff options
Diffstat (limited to '2048/CH6/EX6.1/LS_ex.sce')
-rwxr-xr-x | 2048/CH6/EX6.1/LS_ex.sce | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/2048/CH6/EX6.1/LS_ex.sce b/2048/CH6/EX6.1/LS_ex.sce new file mode 100755 index 000000000..25b3076d7 --- /dev/null +++ b/2048/CH6/EX6.1/LS_ex.sce @@ -0,0 +1,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)
+
+
|