How to smoothen the curve for yaxis in logx axis?

2 ビュー (過去 30 日間)
Anu G
Anu G 2018 年 11 月 21 日
コメント済み: Star Strider 2018 年 11 月 22 日
y=0.2:.1:1
y = [0.92,0.9,0.75,0.47,0.32];
x = [10e-02,10e-1, 10e0, 10e1, 10e2];
ylim ([0.2 1])
loglog(x,y,'LineSmoothing','on')
set(gca,'YLim',[0 1])
grid on
  1 件のコメント
Anu G
Anu G 2018 年 11 月 21 日
I didnt get the smooth curve. Please help me

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

採用された回答

Star Strider
Star Strider 2018 年 11 月 21 日
Try interpolation:
y = [0.92,0.9,0.75,0.47,0.32];
x = [10e-02,10e-1, 10e0, 10e1, 10e2];
xi = logspace(log10(min(x)), log10(max(x)), 50);
yi = interp1(log(x), log(y), log(xi), 'pchip');
ylim ([0.2 1])
loglog(x, y)
hold on
loglog(xi,exp(yi))
hold off
set(gca,'YLim',[0 1])
grid on
  2 件のコメント
Anu G
Anu G 2018 年 11 月 22 日
Thanks a lot
Star Strider
Star Strider 2018 年 11 月 22 日
As always, my pleasure.

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

その他の回答 (0 件)

カテゴリ

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