From b3f3a8ecd454359a2e992161844f2fb599f8238a Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Fri, 4 Oct 2019 12:24:07 +0530 Subject: Initial commit/added all books --- Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11/Ex1_11.R | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11/Ex1_11.R (limited to 'Linear_Algebra_by_Jim_Hefferon/CH1/EX1.11') 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 -- cgit