Using spline fit for different time graphs

8 ビュー (過去 30 日間)
Olca Orakci
Olca Orakci 2015 年 12 月 9 日
コメント済み: Torsten 2015 年 12 月 9 日
Hey, in the experiment we used motion and force sensors to take data. So ploting F-t and x-t is very easy but i dont know how to plot F-x.The problem is times are different in each data so i cant just make a force-position data. The teacher said ''You need to correlate the two arrays using time.However, the time when F and X are measured might be different. Use a spline fit.'' however im new to matlab so i don't know what to do. Can someone explain it to me how can i plot the F-x ? i will attach the datas just in case you want to see.

採用された回答

Torsten
Torsten 2015 年 12 月 9 日
If (tF,F) and (tx,x) are the column vectors in your above files, you can plot F versus x by
tq=0:0.01:5.81;
Fq = interp1(tF,F,tq);
xq = interp1(tx,x,tq);
plot(xq,Fq);
Best wishes
Torsten.
  3 件のコメント
Olca Orakci
Olca Orakci 2015 年 12 月 9 日
btw if i do it like tq=0:0.01:5.81; Fq = interp1(tF,F,tq,'spline'); xq = interp1(tx,x,tq,'spline'); plot(xq,Fq); that means i used spline fit as well right?
Torsten
Torsten 2015 年 12 月 9 日
Yes, you interpolate (tF,F) and (tx,x) by two splines and evaluate these two splines in tq.
Best wishes
Torsten.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by