summaryrefslogtreecommitdiff
path: root/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3
diff options
context:
space:
mode:
Diffstat (limited to 'Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3')
-rw-r--r--Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r19
1 files changed, 19 insertions, 0 deletions
diff --git a/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r
new file mode 100644
index 00000000..5cfa3b38
--- /dev/null
+++ b/Introduction_To_Linear_Algebra_by_Gilbert_Strang/CH2/EX2.6.3/Ex2.6_3.r
@@ -0,0 +1,19 @@
+# Packages used : pracma
+# To install pracma,type following in command line while connected to internet
+# install.packages("pracma")
+# package can be included by command " library(pracma) "
+# for more information about pracma visit https://cran.r-project.org/web/packages/pracma/index.html
+
+# Example : 3 Chapter : 2.6 Pageno : 98
+# Forward Elimination
+library(pracma)
+A<-matrix(c(1,4,2,9),ncol=2)
+b<-c(5,21)
+L<-lu(A)$L
+U<-lu(A)$U
+c<-solve(L,b)
+x<-solve(U,c)
+print("The solution is ")
+print(x)
+
+# The answers may vary due to rounding off values \ No newline at end of file