Clear Filters
Clear Filters

How to get data points from curve?

5 views (last 30 days)
Hi,
I am having the velocity data collected every 6 hours interval for 22 days. It is like a linear plot. How to smooth the curve and estimate 24 hours value for 22 days. The hourly values are with in the maximum and minimum interval of the day and follows the curve pattern. Day one data starts form 1:5 and so on.
Please help me to get the data points for every hour in that curve.
Please find the attached file column 2 is velocity. column one is x value please igonore that

Accepted Answer

KSSV
KSSV on 22 Jul 2020
data = importdata("Maxminpoints.txt") ;
t = data(:,1) ; y = data(:,2) ;
nt = 22*24 ; % number of points if every hour taken for 22 days
ti = linspace(min(t),max(t),nt) ; % make time
yi = spline(t,y,ti) ; % interpolate
Y = reshape(yi,24,[]) ; % reshape to each day
Y_mean = mean(Y) ; % get average value of each day/ 24 hours

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!