Cubic Spline Data Interpolation in MATLAB Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Cubic spline interpolation is a type of interpolation in which data of degree 3 or less is interpolated. Refer to this article to understand the proper theoretical concept of Cubic Spline Interpolation. Now we will look at how to perform cubic spline interpolation in MATLAB. MATLAB provides a simple function for performing cubic spline interpolation on a given data, the spline() function. Syntax: spline(<x_data>, <y_data>, <query_points>) The x_data and y_data are the input data for interpolation and the query contains values for which the user wants the value of the unknown function. We will understand the same with help of various examples. Example 1: Matlab % MATLAB program spline data interpolation x = [1,3,5,7,9]; y = sin(x); query = [0.5,pi,1.37]; spline(x, y, query) Output: Example 2: Matlab % MATLAB program for the interpolated data. query = 0:11; x = [1,3,5,7,9]; y = (x.^3) - (x.^2) + (x.^-1); yx = spline(x, y, query); plot(x, y, 'o', query, yx) Output: Conclusion:This article discussed the usage of the spline function in MATLAB for performing cubic spline interpolation. The above could be used for any data which can be interpolated with a polynomial of degree 3 or less. Comment More infoAdvertise with us Next Article Filtering After Unsampling in MATLAB Interpolation O owl0223 Follow Improve Article Tags : Software Engineering MATLAB-Maths Similar Reads 2D Array Interpolation in MATLAB In this article, we are going to discuss "2D Array Interpolation" in MATLAB with the help of two linspace() and interp2() functions. Functions Usedlinspace( ) The linspace() function is used for the generation linearly spaced vector. Syntax: linspace(a, b) linspace(a, b, n) Here, linspace(a, b) is 4 min read Interpolation in MATLAB Upsampling can be defined as a process that comprises adding zero-valued samples in between existing original samples in order to increase the sampling rate. Upsampling is also called zero-stuffing. Interpolation:Upsampling with Filtering is called Interpolation. Upsampling adds zero-valued samples 3 min read Filtering After Unsampling in MATLAB Interpolation Upsampling with filtering gives the interpolated signal. The Upsampling process just adds zero-valued samples to the given input signal. There is no practical significance of zero-valued samples to obtain interpolated signals. Indeed these zero-valued samples should be converted into their approxima 3 min read 3D Array Interpolation MATLAB Interpolation is a method of finding the value of queried data points based on the trend created by existing data points. MATLAB provides many options to perform interpolation on data of N-dimensions. In this article, we shall discuss how to interpolate data in a 3D array with the help of some exam 3 min read Double Interpolation using Lookup Tables in MATLAB Double interpolation using lookup tables in MATLAB allows for efficient and accurate interpolation of data. This technique is useful when working with large datasets, as it can greatly reduce the amount of computation required to find interpolated values. To perform double interpolation using lookup 3 min read Nearest-Neighbor Interpolation Algorithm in MATLAB Nearest neighbor interpolation is a type of interpolation. This method simply determines the "nearest" neighboring pixel and assumes its intensity value, as opposed to calculating an average value using some weighting criteria or producing an intermediate value based on intricate rules. Interpolatio 3 min read Like