Spline fitting with repeated X's
Show older comments
so here is my matlab code, and the problem is there is repeated x values and spline fit code doesn't work how can i make it so it only takes the first x and doesn't take the repeated ones? And im not good at matlab so, can you please show how to add the code or add it to the original code.
load Pvst1.txt
load Fvst1.txt
tx = Pvst1(:,1);
tF = Fvst1(:,1);
x = Pvst1(:,2);
F = Fvst1(:,2);
tq=0:0.01:5.81;
Fq = interp1(tF,F,tq,'spline');
xq = interp1(tx,x,tq,'spline');
plot(xq,Fq,'ko');
hold on
xlabel('Position (m)','Fontsize',24)
ylabel('Force (N)','Fontsize',24)
title('Force vs. Position for car, Part A','Fontsize',24)
grid on
hold on
Accepted Answer
More Answers (0)
Categories
Find more on Spline Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!