Thread Subject: Spline, Interpolation

Subject: Spline, Interpolation

From: Masoud

Date: 10 Nov, 2008 22:48:03

Message: 1 of 2

Hey guys

I have a problem with spline function,
I have to smooth my data but the spline functions change the start and end point of my data (and It's not what I want)
They change the order of my data too
Could you please guide me?

Subject: Spline, Interpolation

From: Dave Brackett

Date: 10 Nov, 2008 23:03:02

Message: 2 of 2

"Masoud " <smn6@sfu.ca> wrote in message <gfadn3$7os$1@fred.mathworks.com>...
> Hey guys
>
> I have a problem with spline function,
> I have to smooth my data but the spline functions change the start and end point of my data (and It's not what I want)
> They change the order of my data too
> Could you please guide me?


I recently had to deal with this problem and sorted it by weighting the data points the spline is fitting to. If you weight the start and end points much higher than the points inbetween it will take the spline closer to the start and end points. It will not usually go through them exactly but will get close and this depends on the relative weightings.

For instance, I used a weighting of 1 for the start and end points, and 0.005 for the inner points.

Use the curve fitting tool (cftool) and it makes this quite straightforward. You can then generate the m code from this once you have tweaked the settings.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
spinal Masoud 10 Nov, 2008 17:50:07
interpolation Masoud 10 Nov, 2008 17:50:07
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com