Converting indices to time
15 views (last 30 days)
Show older comments
Hi I am very new to the MatLab software, I have a vector size 1x5234400. For the recording software I am using, every 200 indices equates to 1 second, and I am trying to plot the time against the given values of the vector, but currently have the indices plotted against the given values of the vector. How can I go about creating a vector, using my conversion, to plot time against my values?
Thank you
0 Comments
Accepted Answer
Honglei Chen
on 12 Sep 2014
Edited: Honglei Chen
on 12 Sep 2014
This means your sampling rate is 200 Hz, so you can construct your time vector as
fs = 200;
t = (0:numel(x)-1)/fs;
then just do
plot(t,x)
assuming x is your signal
2 Comments
Srinivasulu Avvaru
on 14 May 2019
If we want to plot the above signal with x_axis as standard time. What to do
More Answers (0)
See Also
Categories
Find more on Annotations 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!