フィルターのクリア

Plotting asymptotic limits, interpolation

2 ビュー (過去 30 日間)
pxg882
pxg882 2013 年 2 月 21 日
Hi, I'm plotting the following set of data
x = [0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1.0];
y = [1.7764 1.4849 1.3076 1.1857 1.0957 1.0257 0.9698 0.9235 0.8845];
cs = spline(x,y);
xx = linspace(0.6,1,401);
yy = ppval(cs,xx);
plot(x,y,'o',xx,yy,'-');
axis([0.6 1 0.8 1.8])
xlabel('n')
ylabel('$-H(\eta_{\infty})$','interpreter','latex')
legend('data','spline')
However, I know that for x=0.5 the data set tends asymptotically towards the y-axis. Is there a way I can add this into the plot whilst preserving the 'shape' of the interpolating spline? I've tried approximating this by adding in the point x=0.5 with say y=100, however the curve is not longer smooth.
Any help would be great.
Thanks.

回答 (1 件)

José-Luis
José-Luis 2013 年 2 月 21 日
Let Matlab decide how to make your plot look smooth:
myFun = @(x) ppval(cs,x)
fplot(myFun,[0.5 1])
  2 件のコメント
pxg882
pxg882 2013 年 2 月 21 日
This does produce a smooth plot but it doesn't encapsulate the asymptotic behaviour of the function as x tends towards 0.5. Is there a way to force Matlab into taking behaviour into account?
José-Luis
José-Luis 2013 年 2 月 21 日
編集済み: José-Luis 2013 年 2 月 21 日
What makes you think it is asymptotic? A cubic function never evaluates to infinity. Every piece in the spline is a cubic function. You would need to define the function you are thinking of for the [0.5 0.6] interval.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by