How to plot 8640 datapoints over a 1 day on a second by second basis (i.e. 86400 seconds)
Show older comments
<<

>>
Hi there community!
I wanted to build a signal on signal builder on Simulink. I have about 8640 datapoints that were measured over 10 second intervals for 1 day. I want to present the measured data as a continuous signal spread across the whole duration on a second by second basis- meaning the x-axis time range must be from 0-86400 seconds. How do I go about it? As of now I'm only able to plot the data over the 8640 range on the x-axis.
How to I essentially 'stretch' this data to fit the required range? If if only change the x-axis range on signal builder it doesn't work as it doesn't spread the data.
Any help would be great! Many thanks!!
6 Comments
Akash Menon
on 18 Oct 2018
Dennis
on 18 Oct 2018
Why do you have 8600 datapoints? If you get 1 datapoint every 5s it should be 172800/5.
Do you want to bin your data? Your monitor probably won't be able to display 8600 datapoints correctly.
Akash Menon
on 18 Oct 2018
Dennis
on 18 Oct 2018
Basically you could just change the x values:
mydata=randi(10,864,1);
x=1:864;
x=x*10;
plot(x,mydata)
However 8640 datapoints will be too many to be displayed correctly.
jonas
on 18 Oct 2018
Was the corresponding time not recorded? If not, and you are 100% certain that there is no missing data or significant variation in the sampling frequency, then you can just do as @Dennis suggested and build your own x-vector, although I would suggest using duration or datetime format so that the units are embedded.
x = days(0):seconds(10):days(1)
Akash Menon
on 18 Oct 2018
Accepted Answer
More Answers (0)
Categories
Find more on Multirate Signal Processing 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!

