diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /70/CH3/EX3.3.2 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '70/CH3/EX3.3.2')
-rwxr-xr-x | 70/CH3/EX3.3.2/3_3_2.sci | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/70/CH3/EX3.3.2/3_3_2.sci b/70/CH3/EX3.3.2/3_3_2.sci new file mode 100755 index 000000000..e11d64ede --- /dev/null +++ b/70/CH3/EX3.3.2/3_3_2.sci @@ -0,0 +1,18 @@ +//page 166 +clear; +close; +clc; +disp('b=C+Dt'); +disp('Ax=b'); +A=[1 -1;1 1;1 2]; +disp(A,'A='); +b=[1;1;3]; +disp(b,'b='); +disp('If Ax=b could be solved then they would be no errors, they can''t be solved because the points are not on a line.Therefore they are solved by least squares.') +disp('so,A''Ax^=A''b'); +x=zeros(1,2); +x=(A'*A)\(A'*b); +disp(x(1,1),'C^ ='); +disp(x(2,1),'D^='); +disp('The best line is 9/7+4/7t') +//end
\ No newline at end of file |