필터 지우기
필터 지우기

Spline Interpolation Code Error

조회 수: 1 (최근 30일)
pxg882
pxg882 2013년 1월 25일
Does anybody know why this code isn't running?
x = -4:4;
y = [0 .15 1.12 2.36 2.36 1.46 .49 .06 0];
cs = spline(x,y);
xx = linspace(-4,4,101);
yy = ppval(cs,xx);
plot(x,y,'o',xx,yy,'-');
I can't figure it out! Thanks.
  댓글 수: 3
pxg882
pxg882 2013년 1월 25일
Don't quite know what was going on there, yeah it does work fine. Sorry about that!
As an aside, I'm plotting the following but want the y-axis to start from 0. Is there a way to implement this into the code?
x = 1:-.01:0.90;
y = [13 17 17 18 18 25 25 24 24 26 46];
plot(fliplr(x),fliplr(y),'o');
set(gca,'XDir','reverse');
xlabel('n')
ylabel('\eta_{\infty}')
pxg882
pxg882 2013년 1월 25일
Figured it out.
No worries

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by