Kshitij Singh answered .
2025-07-10 22:56:03
This is achievable in MATLAB with some commands to clean up our data first and then create a Timeseries Object. Assuming you have an array of real numbers of size 300x6 meaning you have 6 sensors and 300 data points for each for example:
>> data = [rand(100,2) ; zeros(200,2)]
>> data = [data, rand(300,4)];
first you can select the columns with a specific sample rate, for example the first 2:
>> dataAtSampleRate1 = data(:,1:2);
then we can clean it up by noticing that many of the values of these columns are zero, meaning it was padded with non-existent data, so we can remove them. First we find the first row where the padding starts:
>> [index, ~] = find(~dataAtSampleRate1,1)
then we remove the data starting at that row:
>> dataAtSampleRate1(index:end,:) = [];
Now we need to create a Timeseries Object to specify a sample time for the data and assign times to each row:
>> ts = timeseries(dataAtSampleRate1)
Now we can double-click on the "ts" variable in the Workspace window, select "Uniform time vector" and add start and end times for the data collection. This will automatically calculate the measurement time for all the data points in "ts".
Not satisfied with the answer ?? ASK NOW