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?
"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.
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.