fit curve with parameter
古いコメントを表示
I have some points, annotated from an xray, along the spine. I need to fit a curve through these points. After that, i want to parametrize my fitted curve from 0 to 1, so i can move along the curve in equal intervals. If i just project my points onto the x axis, my line will be distorted.
So i want to choose point 0, which should give me the x/y coordinates of the fitted curve and the slope of the curve at this point. Point 0.5 should give me the point in the middle of the curve and its x/y values and the slope there, and point 1 the last point of the curve.
Any ideas how to do this? I thought about spline/cscvn, but i don't really get it...
3 件のコメント
Rik
2020 年 10 月 19 日
You could simply not tell Matlab that the two curves you're fitting are (t,x) and (t,y).
Stefan Lang
2020 年 10 月 19 日
Rik
2020 年 10 月 19 日
E.g. this:
a=linspace(0,pi,100);x=5*sin(a)+rand(size(a));y=6*cos(a)+rand(size(a));%replace with your data
subplot(1,2,1)
plot(x,y)
title('actual data')
subplot(1,2,2)
t=linspace(0,1,numel(x));
plot(t,x),hold on,plot(t,y),hold off
title('as a function of t')
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!