summaryrefslogtreecommitdiff
path: root/Numerical_Methods_by_E_Balaguruswamy/CH9/EX9.11
diff options
context:
space:
mode:
Diffstat (limited to 'Numerical_Methods_by_E_Balaguruswamy/CH9/EX9.11')
-rw-r--r--Numerical_Methods_by_E_Balaguruswamy/CH9/EX9.11/Ex9_11.R24
1 files changed, 24 insertions, 0 deletions
diff --git a/Numerical_Methods_by_E_Balaguruswamy/CH9/EX9.11/Ex9_11.R b/Numerical_Methods_by_E_Balaguruswamy/CH9/EX9.11/Ex9_11.R
new file mode 100644
index 00000000..31463be2
--- /dev/null
+++ b/Numerical_Methods_by_E_Balaguruswamy/CH9/EX9.11/Ex9_11.R
@@ -0,0 +1,24 @@
+#Example 11 Chapter 9 Page no.: 306
+#Cubic splines
+
+#Installing and importing library 'pracma'
+install.packages("pracma")
+library("pracma")
+
+#Given Data
+mydata<-data.frame(i= c(0,1,2),
+ xi= c(4,9,16),
+ fi= c(2,3,4),
+stringsAsFactors = TRUE
+
+)
+mydata
+
+x<-mydata$xi
+f<-mydata$fi
+
+#function to find spline at xi
+C <- signif(cubicspline(x, f, xi = 7),5)
+
+cat("Cubic spline of f(7) is :",C)
+