필터 지우기
필터 지우기

How can I differentiate my B-Splines?

조회 수: 3 (최근 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));
else
y = zeros(size(u));
ind = find(u>0 & u<2) ;
y(ind) = 1 - abs(u(ind)-1);
end
end
  댓글 수: 1
dpb
dpb 2016년 8월 27일
편집: dpb 2016년 8월 28일
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...

댓글을 달려면 로그인하십시오.

답변 (1개)

Shruti Shivaramakrishnan
Shruti Shivaramakrishnan 2016년 8월 31일
A similar question has been answered on the following MATLAB Answers link :
https://www.mathworks.com/matlabcentral/answers/95194-how-do-i-find-the-derivative-of-a-spline-curve-in-matlab-7-9-r2009b
You could refer to the second part of the answer that describes the differentiation of a spline without using the curve-fitting toolbox.

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by