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

Rik
Rik 2020년 2월 5일
Have you tried spline interpolation?
Vishnu Dhakad
Vishnu Dhakad 2020년 2월 5일
Yes
I used following code but I did not get plot like figure02
>> xq = (0.25:0.001:32);
>> V = interp1(X, Y1, xq, 'spline');
>> hold on
>> loglog(xq,V,'r')
Rik
Rik 2020년 2월 5일
If you want a smooth line in the loglog domain, you should interpolate in that domain as well.
Vishnu Dhakad
Vishnu Dhakad 2020년 2월 5일
thanks for your suggetion
how to do?

댓글을 달려면 로그인하십시오.

답변 (2개)

Hiro Yoshino
Hiro Yoshino 2020년 2월 5일

0 개 추천

How about increasing the number of data by using interpolation?:
Rik
Rik 2020년 2월 5일

0 개 추천

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

Vishnu Dhakad
Vishnu Dhakad 2020년 2월 6일
Thanks for your answer
I am tried above code and got a plot(Figure04).
But I want plot like Figure02(which is genereted by excel).
Thanks again
Rik
Rik 2020년 2월 6일
I didn't use your data, but generated some random data. Did you try using your data and my code?
Vishnu Dhakad
Vishnu Dhakad 2020년 2월 7일
Yes, I have used your code.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

2020년 2월 5일

댓글:

2020년 2월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by