Splines: How to find vector/array from smoothing line (function - csaps), or another function (still using a smoothing parameter)?
Mostrar comentarios más antiguos
Question: Consider the coding:
sample = 100; % Data points
x = linspace(-5,5); % Data bounds
y= 1.6 * x.^2 +6; % Function
r = randn(10,sample); % Add noise
p = 0.1; % Specify "smoothness"
pp = csaps(x,y,p); % Specify Spline/Smoothing line
hold on
plot(x,r(1,:)+y,"b") % Blue :Plot random data
plot(x,y,"k") % Black :True "y data"
fnplt(pp,"r") % Red :Plot Spline/Smoothing line
Just like I have the precise data of vectors "y" and "r", I would like to have the corresponding data from the smoothing-line (Which is not exactly the same as vectors "y" and "r" -> as "p" represents an offset from the true "y" line).
________________________________________________
Question: Consider the graph:

I have the vectors of the black and blue lines, but I need the vector of the red line. (Notice that they are three different lines)
_______________________________________________
If it is impossible to gather this corresponding data-points from the spline function "csaps", is there another way of obtaining this data(another spline function - While still being able to specify a smoothing parameter "p")? Maybe obtaining a "spline formula", and then by inserting the "x" vector obtain the corresponding spline data?
Thank you!
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Spline Construction en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!