Splines can be used to approximate a \"parametric curve\" (x(t), y(t)) by using
ID: 3121839 • Letter: S
Question
Splines can be used to approximate a "parametric curve" (x(t), y(t)) by using a spline for each of the functions separately and then plotting the resulting function y vs. x. Draw a script letter on a graph paper, place a few points on the letter and take down the coordinates of the points (it doesn't have to be many points: 5 to 12 points is enough, depending on the chosen letter, if chosen wisely). Create two arrays with these data and find the spline approximations S_y(t) and S_x(t) for each of the functions y(t) and x(t) with parameter t representing the array index. Plot the resulting S_y vs. S_x. Despite only using a few points for each letter, the resulting plot should be nice and smooth. Experiment with different "end conditions". Explain your choice.Explanation / Answer
Let us perform this operation in MATLAB.
Syntax
s = spline(x,y,xq)
pp = spline(x,y)
Description
s = spline(x,y,xq) returns a vector of interpolated values s corresponding to the query points in xq. The values of s are determined by cubic spline interpolation of x and y.
pp = spline(x,y) returns a piecewise polynomial structure for use by ppval and the spline utility unmkpp.
This example fits some data using a cubic spline interpolant and several smoothing splines.
Create the variables in your workspace:
Open the Curve Fitting app by entering:
Select x and y from the X data and Y data lists.
The Curve Fitting app fits and plots the data.
Fit the data with a cubic spline interpolant by selecting Interpolant fit type and the Method Cubic.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.