MATLAB Answers

How can I differentiate my B-Splines?

17 ビュー (過去 30 日間)
Fabian Schaum
Fabian Schaum 2016 年 8 月 27 日
回答済み: Shruti Shivaramakrishnan 2016 年 8 月 31 日
Trying to differentiate these B-Splines over [0,1], where n : order of b-spline, u : breaks.
I do not have the curve fitting toolbox and I have already tried to find something here/on stackexchange, but nothing seems to work. I'd appreciate help or explanation/ pointing out my mistakes or just plain code to make it work. Thanks!
function y = splines(u,n)
if n>2
y = ((u/(n-1)).*splines (u,n-1))+ (((n-u)/(n-1)).*splines(u-1,n-1));
y = zeros(size(u));
ind = find(u>0 & u<2) ;
y(ind) = 1 - abs(u(ind)-1);

  1 件のコメント

dpb 2016 年 8 月 27 日
If you define the coefficients properly(), couldn't you then just use *polyder for each segment?
() Same order as used by *polyfit and friends, that is...

Sign in to comment.

回答 (1 件)

Shruti Shivaramakrishnan
Shruti Shivaramakrishnan 2016 年 8 月 31 日
A similar question has been answered on the following MATLAB Answers link :
You could refer to the second part of the answer that describes the differentiation of a spline without using the curve-fitting toolbox.

  0 件のコメント

Sign in to comment.

Translated by