Interpolation with a smooth curve
45 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Utku Palakci
am 30 Dez. 2018
Kommentiert: Utku Palakci
am 30 Dez. 2018
How can I write a script that plots the data and then interpolates it with a smooth curve (plot
the curve too). also find and plot the value of y for t=4.
t 0 0.5 1.0 6.0 7.0 9.0
y 0 1.6 2.0 2.0 1.5 0
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 30 Dez. 2018
Bearbeitet: madhan ravi
am 30 Dez. 2018
t = [0 0.5 1.0 6.0 7.0 9.0];
y = [0 1.6 2.0 2.0 1.5 0];
y_when_t_is_4 = interp1(t,y,4);
xx=linspace(t(1),t(end),1000);
yy=interp1(t,y,xx,'spline'); % use whatever method suits you the best
plot(t,y,'o',xx,yy)
3 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
