How to smoothen the curve for yaxis in logx axis?

3 次查看(过去 30 天)
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

采纳的回答

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

更多回答(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