summaryrefslogtreecommitdiff
path: root/Linear_Algebra_by_Jim_Hefferon/CH1/EX2.5
diff options
context:
space:
mode:
Diffstat (limited to 'Linear_Algebra_by_Jim_Hefferon/CH1/EX2.5')
-rw-r--r--Linear_Algebra_by_Jim_Hefferon/CH1/EX2.5/Ex1_2_5.R19
1 files changed, 19 insertions, 0 deletions
diff --git a/Linear_Algebra_by_Jim_Hefferon/CH1/EX2.5/Ex1_2_5.R b/Linear_Algebra_by_Jim_Hefferon/CH1/EX2.5/Ex1_2_5.R
new file mode 100644
index 00000000..c37e92e8
--- /dev/null
+++ b/Linear_Algebra_by_Jim_Hefferon/CH1/EX2.5/Ex1_2_5.R
@@ -0,0 +1,19 @@
+#Example 2.5,section 1.2,page 15
+#package used matlib v0.9.1
+#install package using command: install.packages("matlib")
+#Github reposiory of matlib :https://github.com/friendly/matlib
+
+#installation and loading library
+#install.packages("matlib")
+library("matlib")
+
+#program
+A <- matrix(c(1,2,3,2,0,2,0,1,1,0,0,-1),ncol = 4)
+b <- c(1,2,4)
+Ab <- cbind(A,b) #augmented matrix
+Ab <- rowadd(Ab,1,2,-2)
+Ab <- rowadd(Ab,1,3,-3)
+Ab <- rowadd(Ab,2,3,-1)
+Ab
+#The leading variables are x, y, and w. The variable z is free.
+#although there are infinitely many solutions, the value of w doesn't vary but is constant w = -1. \ No newline at end of file