From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 70/CH3/EX3.3.2/3_3_2.sci | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 70/CH3/EX3.3.2/3_3_2.sci (limited to '70/CH3/EX3.3.2/3_3_2.sci') 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 -- cgit