Curve smoothing using Matlab

I have got an experimental curve which is a bit wavy (curve has a lot of noise and hence is wavy).
I want to smoothn the curve using Matlab.
Can anyone advise the best tool in Matlab for this?
I wanted to attach the plot of curve which needs to be smoothened but couldn't find a way to attach it here.
shalini

답변 (3개)

Jonathan Sullivan
Jonathan Sullivan 2012년 4월 6일

0 개 추천

help filter
doc filter

댓글 수: 1

Shalini
Shalini 2012년 4월 6일
Do you mean:
yy = smooth(y)
where; yy is the smoothed vector? And, y is the dependent variable (of the curve) that needs to be given?

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

Richard Willey
Richard Willey 2012년 4월 6일

0 개 추천

I have a function called FitIt on the file exchange that might prove useful.
FitIt combines
Local regression (to smooth your data set) Cross validation (to estimate an optimal spanning parameter) Bootstrap (to generate confidence intervals)
FitIt has dependencies on both Curve Fitting Toolbox and Statistics Toolbox.

댓글 수: 4

Shalini
Shalini 2012년 4월 9일
Sorry Richard, I was sick for 2 days..how can I access your function FitIt through fiel exchange?
Please help
Richard Willey
Richard Willey 2012년 4월 10일
Hi Shalini
You can download the function from
http://www.mathworks.com/matlabcentral/fileexchange/31562-data-driven-fitting-with-matlab
Please note: Under the hood, this function uses the "Smmoth" function that Sean is recommending. The major difference is that I added some code that automatically computes an optimal spanning parameter for the smooth function and also gives you the option of computing confidence intervals.
There is a recorded webinar available on this topic at
http://www.mathworks.com/company/events/webinars/wbnr56627.html?id=56627&p1=961661709&p2=961661727
Taymaz Tek
Taymaz Tek 2012년 6월 9일
Hi everybody,
I had been trying to use your function, fitit, in my own problem but it didn't work well. In the case of your demo, it is quite ok but when I try to run it with my signal, there is an error:
??? Error using ==> horzcat
CAT arguments dimensions are not consistent.
Error in ==> fitit at 21
sse(j) = sum(crossval(f,[X,Y],'partition',cp));
can you please let me know where this can be driven?
Taymaz Tek
Taymaz Tek 2012년 6월 9일
Thanks in adavnce

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

Sean de Wolski
Sean de Wolski 2012년 4월 9일

0 개 추천

How about smooth() :)
doc smooth

댓글 수: 3

Shalini
Shalini 2012년 4월 9일
I'm new to matlab...How to use this smooth?Why do you say doc smooth? Is there a document?
Sean de Wolski
Sean de Wolski 2012년 4월 9일
If you run:
doc smooth
at the command line it will tell you all about the SMOOTH function, (well as long as you have a somewhat recent version of MATLAB with the Curve Fitting Toolbox)
Samuel Suakye
Samuel Suakye 2017년 6월 6일
figure clear; clc; delta=[0.0259, 0.0518, 0.0776, 0.1035, 0.1293]*10; %delta=0.01:0.09:0.5; delta1=0.01:0.1:0.5; hbar=6.5821220*10e-16; k=8.617385*10e-5; T=300; d=[100 150 200]*10e-10; m = 9.1093897*10e-31; v = 2.8*10e8; c = 3.0*10e8; wp = 10e12; w = 0.7071; gamma = (1-((v^2)/(c^2)))^-0.5; delta2= delta1./(k*T); %% figure hold on for i = 1:length(d) wo=(wp^2*m*d(i)^2*delta1.*besseli(1,delta2))./(hbar^2*besseli(0,delta2)).^(0.5); delta3=delta./(k*T); therta = asind(1-(w.^2./wo.^2)).^0.5; wb = gamma.*wo.*cosd(therta); %wb^2=2 rho=(hbar^2.*2.*besseli(0,delta3))./(wp^2*m*d(i)^2*k*T.*delta3.*besseli(1,delta3)); plot(delta3,rho,'LineWidth',1.5) end %% xlabel('\Delta^*') ylabel('E_b/E_s') hold on grid on All comments are not working for my codes above

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

카테고리

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

질문:

2012년 4월 6일

댓글:

2017년 6월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by