how to plot smooth line plot?

1 vue (au cours des 30 derniers jours)
Vishnu Dhakad
Vishnu Dhakad le 5 Fév 2020
Commenté : Vishnu Dhakad le 7 Fév 2020
I have data in x,y.
I have plotted x,y in log scale in both axises
but I did not getting smooth plot.
How to get it like excel plot.
please find the attached data and pics of the plot
Figure01 from MATLAB
Figure02 from Excel
I dont have signal processing tool.
  4 commentaires
Rik
Rik le 5 Fév 2020
If you want a smooth line in the loglog domain, you should interpolate in that domain as well.
Vishnu Dhakad
Vishnu Dhakad le 5 Fév 2020
thanks for your suggetion
how to do?

Connectez-vous pour commenter.

Réponses (2)

Hiro Yoshino
Hiro Yoshino le 5 Fév 2020
How about increasing the number of data by using interpolation?:

Rik
Rik le 5 Fév 2020
The code below generates some example data and then interpolates the data in the loglog domain.
%generate some example data
X=exp(linspace(log(0.25),log(32),40));
Y1=randi([15 25],1,numel(X)).*exp(X./15);
xq = (0.25:0.001:32);
V = exp(interp1(log(X), log(Y1), log(xq), 'spline'));
figure(1),clf(1)
loglog(X,Y1,'.b')%plot orignal data
hold on
loglog(xq,V,'r')%add interpolation
hold off
  3 commentaires
Rik
Rik le 6 Fév 2020
I didn't use your data, but generated some random data. Did you try using your data and my code?
Vishnu Dhakad
Vishnu Dhakad le 7 Fév 2020
Yes, I have used your code.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by