summaryrefslogtreecommitdiff
path: root/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11
diff options
context:
space:
mode:
authorprashantsinalkar2019-10-04 12:24:07 +0530
committerprashantsinalkar2019-10-04 12:24:07 +0530
commitb3f3a8ecd454359a2e992161844f2fb599f8238a (patch)
tree7bb3f64824627ef179d5f341266a664fd0b69011 /Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11
parent80492d3788738910b80dc16f918511057b7321d6 (diff)
downloadR_TBC_Uploads-b3f3a8ecd454359a2e992161844f2fb599f8238a.tar.gz
R_TBC_Uploads-b3f3a8ecd454359a2e992161844f2fb599f8238a.tar.bz2
R_TBC_Uploads-b3f3a8ecd454359a2e992161844f2fb599f8238a.zip
Initial commit/added all books
Diffstat (limited to 'Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11')
-rw-r--r--Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11/Ex1_11.R18
1 files changed, 18 insertions, 0 deletions
diff --git a/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11/Ex1_11.R b/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11/Ex1_11.R
new file mode 100644
index 00000000..a005839b
--- /dev/null
+++ b/Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11/Ex1_11.R
@@ -0,0 +1,18 @@
+#Example 1.11,page 6
+#package used: matlib
+#installation run command : install.packages("matlib")
+#package repo : https://github.com/friendly/matlib
+
+#installation and loading library
+#install.packages("matlib")
+library("matlib")
+
+#program
+A <- matrix(c(1,2,0,0,-1,-2,1,0,0,1,0,2,0,2,1,1),ncol=4)
+b <- c(0,4,0,5)
+Ab <- cbind(A,b)
+Ab <- rowadd(Ab,1,2,-1)
+Ab <- rowswap(Ab,2,3)
+Ab <- rowadd(Ab,3,4,-2)
+Ab
+#Back-substitution gives w = 1, z = 2 , y = -1, and x = -1. \ No newline at end of file