diff options
Diffstat (limited to '3293/CH8/EX8.28/Ex8_28.sce')
-rwxr-xr-x | 3293/CH8/EX8.28/Ex8_28.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/3293/CH8/EX8.28/Ex8_28.sce b/3293/CH8/EX8.28/Ex8_28.sce new file mode 100755 index 000000000..f9d076267 --- /dev/null +++ b/3293/CH8/EX8.28/Ex8_28.sce @@ -0,0 +1,26 @@ +//page 307
+//Example 8.28
+clc;
+clear;
+close;
+disp('x1 and x2 are two real nos. i.e., x1^2 + x2^2 = 1');
+x1 = rand();
+x2 = sqrt(1 - x1^2);
+disp(x1,'x1 = ');
+disp(x2,'x2 = ');
+B = [x1 x2 0;0 1 0;0 0 1];
+disp(B,'B = ');
+disp('Applying Gram-Schmidt process to B:')
+a1 = [x1 x2 0];
+a2 = [0 1 0] - x2 * [x1 x2 0];
+a3 = [0 0 1];
+disp(a1,'a1 = ');
+disp(a2,'a2 = ');
+disp(a3,'a3 = ');
+U = [a1;a2/x1;a3];
+disp(U,'U = ');
+M = [1 0 0;-x2/x1 1/x1 0;0 0 1];
+disp(M,'M = ')
+disp(inv(M) * U,'inverse(M) * U = ');
+disp('So, B = inverse(M) * U');
+//end
|