Question

I have loaded a list of data in MATLAB:

sample = 

            data: [120000x1 double]
           units: 'Volts'
          labels: 'Analog input'
             isi: 1
       isi_units: 'ms'
    start_sample: 0

Now I want to display these in time domain. How can I add a time domain? For example, 1ms for each data; 120 seconds for 120000s

Was it helpful?

Solution

You can construct a time vector like this:

 t = 0:.001:120000*.001-.001;

or for a generic time delta and data length:

dt = .001;

t = 0: dt : length(data) * dt - dt;

Then plot the time series data:

plot(t,data);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top