Find the limits of the parameter describing a spline curve (made using cscvn)

2 ビュー (過去 30 日間)
Anshuman Pal
Anshuman Pal 2022 年 2 月 2 日
回答済み: Anshuman Pal 2022 年 2 月 2 日
Hello,
I am trying to interpolate a space curve in 3d using splines. This link (https://in.mathworks.com/help/curvefit/splines-in-the-plane.html) shows that the spline is parametrised by a single parameter t, and hence I can evaluate the spline curve at distinct points using fnval(curve, t). However, how do I know the limits (min and max) of this parameter t?
For example, here I plot an incomplete curve (in blue) using an arbitrary max of 100.5 (the min is 0, I presume). The entire curve is plotted in dashed red (see attached file):
curve=cscvn(xyz);
% Evaluate the spline at definite points
t = linspace(0,100.5,501); % 100.5 is arbitrary
cv = fnval(curve, t);
figure; hold on
fnplt(curve,'r--',2) % plot entire spline
plot3(cv(1,:),cv(2,:),cv(3,:),'b','LineWidth',5);
view(3)

採用された回答

Anshuman Pal
Anshuman Pal 2022 年 2 月 2 日
I found the answer! All I had to do was search in the properties of curve. So, I have to use min(curve.breaks) and max(curve.breaks)as the limits of t:
t = linspace(min(curve.breaks), max(curve.breaks),501);

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by