summaryrefslogtreecommitdiff
path: root/Numerical_Methods_by_E_Balaguruswamy/CH7/EX7.1/Ex7_1.R
diff options
context:
space:
mode:
Diffstat (limited to 'Numerical_Methods_by_E_Balaguruswamy/CH7/EX7.1/Ex7_1.R')
-rw-r--r--Numerical_Methods_by_E_Balaguruswamy/CH7/EX7.1/Ex7_1.R12
1 files changed, 12 insertions, 0 deletions
diff --git a/Numerical_Methods_by_E_Balaguruswamy/CH7/EX7.1/Ex7_1.R b/Numerical_Methods_by_E_Balaguruswamy/CH7/EX7.1/Ex7_1.R
new file mode 100644
index 00000000..31f25f49
--- /dev/null
+++ b/Numerical_Methods_by_E_Balaguruswamy/CH7/EX7.1/Ex7_1.R
@@ -0,0 +1,12 @@
+# Example 1 Chapter 7 Page no.: 211
+# Solving System of Equations
+
+#Define Sysytem of Equations in Matrix form
+A<-matrix(c(3,2,1,2,3,2,1,2,3),nrow = 3,ncol = 3,byrow = TRUE)
+A
+b<-matrix(c(10,14,14),nrow = 3,ncol = 1)
+b
+
+k <- solve(A,b)
+cat("Solution:\n x=",k[1],"\n y=",k[2],"\n z=",k[3])
+