Cubic Spline Fit-Just confirm the code

조회 수: 2 (최근 30일)
manish sharma
manish sharma 2012년 7월 11일
Hi,
I have two vectors, X, and Y (of same size).
Now, I am interested in cubic spline fit of the data points (Y) at certain values (let's call this vector as "x") by the code:
-------------------------------
x = 1:1:125;
y = interp1(X,Y, x,'spline')
plot(x,y,'--r')
-------------------------------
PLEASE CONFIRM:
The "plot (x,y,'--r')" command will give the cubic spline fit for data points (represented in Y), right?

채택된 답변

John Petersen
John Petersen 2012년 7월 11일
right. You can verify this by
plot(X,Y,,'.',x,y);legend('Samples','Spline')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Splines에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by