diff options
Diffstat (limited to 'Linear_Algebra_by_Jim_Hefferon/CH1/EX1.12/Ex1_12.R')
-rw-r--r-- | Linear_Algebra_by_Jim_Hefferon/CH1/EX1.12/Ex1_12.R | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.12/Ex1_12.R b/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.12/Ex1_12.R new file mode 100644 index 00000000..e7c4bf79 --- /dev/null +++ b/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.12/Ex1_12.R @@ -0,0 +1,17 @@ +#Example 1.12 Section I. Solving Linear Systems page7
+#package used matlib v0.9.1
+#install package using command: install.packages("matlib")
+#Github reposiory of matlib :https://github.com/friendly/matlib
+
+#installing and loading library
+#install.packages("matlib")
+library("matlib")
+
+#program
+A <- matrix(c(1,2,2,3,1,2),ncol = 2)
+b <- c(1,-3,-2)
+#for this problem we cannot use normal method because the number of equations is more than number of variables
+#so we use gaussian elimination technique.
+gaussianElimination(A, b, tol = sqrt(.Machine$double.eps), verbose = FALSE,
+ latex = FALSE, fractions = FALSE)
+# result shows that one of the equations is redundant, here x=-2,y=1
\ No newline at end of file |