# Curve smoothing of a voltage-time plot

3 vues (au cours des 30 derniers jours)
Chinmaya le 31 Mar 2023
Commenté : Chinmaya le 31 Mar 2023
Hello,
I have a voltage-time plot as shown below, the voltage values are fluctauting and hence I am not able to use it in my end application.
Is there any tool available in matlab that I can use to smooth the curve.
I have attached the voltage-time values for reference.
Regards
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (2)

Pratheek le 31 Mar 2023
Hi Chinmaya,
MATLAB provides a built-in function called smoothdata() that can be used to generate smoother plots compared to those generated using raw data. By applying smoothing techniques to the data, smoothdata() can effectively reduce noise and highlight underlying trends in the data. Refer this link for more information Smooth noisy data - MATLAB smoothdata (mathworks.com)
Please find attached the code snippet that can be used to smooth the data in MATLAB.
% Load data from xlsx file
% Extract relevant data
x = data(:,1);
y = smoothdata(data(:,3));
% Plot data
plot(x,y);
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Chinmaya le 31 Mar 2023
Hello pratheek,
Thanks for the answer, smoothdata reduces lot of fluctuations.The smoothened curve is as shown below
Can we further smoothen the curve as shown in below reference.
Regards

Connectez-vous pour commenter.

Raghunathraju le 31 Mar 2023
Hi Chinmaya,
You can smooth your curve using smooth function. You can refer the following example to use the smooth function
x=a(:,1);
y=a(:,3);
yy1 = smooth(x,0.1,'loess');
yy2 = smooth(y,0.1,'rloess');
subplot(2,1,1)
plot(a(:,1),a(:,3))
subplot(2,1,2)
plot(yy1,yy2)
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Chinmaya le 31 Mar 2023
Hello Raghunathraju,
Thanks for the answer, Is there a way by which we can further smoothen the cure, as shown in below reference.
Regards

Connectez-vous pour commenter.

### Catégories

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

R2022a

### Community Treasure Hunt

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

Start Hunting!

Translated by