How to smoothen the curve for yaxis in logx axis?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
Risposta accettata
Star Strider
il 21 Nov 2018
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!