{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

parametricspline

# parametricspline - ti = vector compared with ti =...

This preview shows page 1. Sign up to view the full content.

function [xi,yi,ti] = paramSpline(x,y,n) % paramSpline Parametric spline interpolation. % % Synopsis: [xi,yi,ti] = paramSpline(x,y) % [xi,yi,ti] = paramSpline(x,y,n) % % Input: x,y = vectors of data defining a curve in (x,y) plane % n = (optional) number of points to generate on the % interpolated curve. Default: n = 100 % % Output: xi,yi = vectors of points on parametric curves x = xi(ti) % and y = yi(ti) obtained from seperate cubic % spline interpolations of x and y. Plotting (xi,yi) % produces a smooth curve through the (x,y) data.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % % ti = vector compared with ti = linspace(min(t),max(t),n) % where t = 1:length(x) is a vector of indices for x and % y, and n is an optional input patameter. if nargin<2, error('not enough input patameters'); end if nargin<3, n = 100; end t=1:length(x); ti=linspace(min(t),max(t),n); xi=splint(t,x,ti); yi=splint(t,y,ti); plot(x,y,'o',xi,yi,'-'), xlabel('X'), ylabel('Y'), title('Cubic Spline Interpolation'), axis([-1 4 0 6]); I %%>>x=[0,1,2,2,3]; %%>>y=[1,3,3,4,5]; %%>>[xi,yi,ti]=paramSpline(x,y); %...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern