Weighted cubic spline (csaps) -- varying weighting factor
Afficher commentaires plus anciens
%weighted cubic spline
x=0:0.1:10; %input data
y=5*sin(1.5*x);
x2=x;
y2=0.5+(0.5*sin(1.5*x));
pp = csaps(x,y,1,x) %weighted cubic spline
plot(x,y); hold all; plot(x2,y2); hold all; plot(x,pp,'*'); legend('input data','input weighting data','weighted cubic spline') %
I need to modify the above code to use the current y2 value to recursively (for each value of y) update the c-spline weighting factor for each value of y.
i.e. instead of:
pp = csaps(x,y,1,x)
i will have something like:
pp = csaps(x,y,[current_y2_value],x)
so the output spline will have different weights for each value of y.
please can you help
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Splines dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!