Curve smoothing of a voltage-time plot
4 views (last 30 days)
Show older comments
Commented: Chinmaya on 31 Mar 2023
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.
Could anyone please help me out on curve smoothing for the same.
Is there any tool available in matlab that I can use to smooth the curve.
I have attached the voltage-time values for reference.
Pratheek on 31 Mar 2023
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
data = xlsread('query_curve_smoothing.xlsx');
% Extract relevant data
x = data(:,1);
y = smoothdata(data(:,3));
% Plot data
Raghunathraju on 31 Mar 2023
You can smooth your curve using smooth function. You can refer the following example to use the smooth function
yy1 = smooth(x,0.1,'loess');
yy2 = smooth(y,0.1,'rloess');
for more information you can refer MATLAB Documentation
Find more on Smoothing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!