Cubic Spline calculation after optimization

1 回表示 (過去 30 日間)
David
David 2014 年 10 月 21 日
Hello dear MATLAB community,
at the moment I try to calculate a trajectory by solving a parametrised optimization problem. This works pretty good for many cases. But there are some cases where I get weird results.
The picture shows a weird calculated trajectory. The spline should go through the points but its shape is very weird. At the moment I´m calculating the trajectory with :
F1 = griddedInterpolant(f,x,'spline');
Way(1,:) = F1(x2);
F3 = griddedInterpolant(f,y,'spline');
Way(2,:) = F3(x2);
(also tried 'pchip' and 'cubic')
I have to use griddedInterpolant because I need to speed up the whole calculation and because I´m working with a parametrised function. All other functions (like cscvn or csape) take too long. My question is: Is there a possibility to set the first derivative of the first and the last point to 0 or to calculate the natural cubic spline and not a not-a-knot spline?
Thank you for your help!

回答 (0 件)

カテゴリ

Help Center および File ExchangeSplines についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by