From: PICTUN Z on
I need to smooth data with special smoothing constrains when using cubic spline smoothing: as the roughness decreases to 0, the smoothed data will be constant.

Here is an example:
x=linspace(1,10,10); y=[80 80 80 80 80 8 8 8 8 8];
In the following figure, symbols +$&*< stand for the smoothed data while roughness decreases. Notice when roughness=0(in this case, it's represented by symbol "<"), the smoothed data are constant, say 24. Although all the same symbols are on respective 'straight' lines, it doesn't mean they have to be so in reality. They can be curves, but as roughness approaches 0, the curve turns into a horizontal line.

+ + + + + here y=80

$ $ $ $ $

& & & & &

* * * * *

< < < < < < < < < < here y=24
* * * * *
& & & & &
$ $ $ $ $
+ + + + + here y=8

How to do this in Matlab? Can anyone give me some hint? Codes are especially welcomed :)

BTW, I use the function csaps in the first place, but when roughness=0, the result is not a horizontal line, instead, it's diagonal.

Thanks.

Pictun
 | 
Pages: 1
Prev: Download mcr 7.5 for linux 32 bit
Next: colormap