Least Squares and Raised Cosine Interpolation help

For an assignment, I am given a set of Xs and F(x)s, and I need to use Raised Cosine and Least Squares interpolation. My teacher said that there is a function in Matlab for each that will easily solve them, but when he tried to show us in class, he "couldn't find them."
Is there a simple solution?

Answers (1)

Perhaps he means polyfit().

2 Comments

I used polyfit to do a Lagrange interpolation. Can it be re purposed for Raised Cosine or Least Squares?
I never heard of raised cosine, but it it's your assignment I'm sure your professor went over it. But a regular polynomial regression like polyfit does minimizes the sum of the squares of the residuals, so doesn't that fit your definition of "least squares"? If you don't have a high enough order then it won't go through your training points, but when you get the "in between" points, who's to say whether they are interpolated or estimated? As far as I'm concerned, you could consider them interpolation. If it's your assignment, then he probably wants you to do it the hard/manual way rather than use some one line call to some built-in function.

Sign in to comment.

Products

Asked:

on 4 Oct 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!