Create a time table
Show older comments
Hey guys, thanks in advance.
I have a program that reads samples from a hardware receiver. When it starts receiving I use:
dev.start();
fprintf('Start of LimeSDR\n');
tic;
start_time=datestr(now);
Then it receives this samples:
indRx1 = 1; % index of the last received sample
[samples1, ~, samplesLength1] = dev.receive(Fs*Ts,1);
bufferRx1(indRx1:indRx1+samplesLength1-1) = samples1;
pause(1)
tempo_rececao=toc;
stop_time=datestr(now);
and stops receiving:
% Cleanup and shutdown by stopping the RX stream and having MATLAB delete the handle object.
dev.stop();
clear dev;
fprintf('Stop of LimeSDR\n');
I want to create a timetable that has start time, stop time, Fs(frequency sampling), and samples1(number of samples).
I have done this
TT=array2timetable(samples1,'SampleRate',Fs,'StartTime',start_time);
But this only gives me a column with start time and the samples. How can I do this,
Thank you
2 Comments
Eric Sofen
on 21 Jun 2022
Timetable works with datetime and duration data types, but not datestr, so your start_time and stop_time should be:
start_time = datetime("now");
I'm unclear on your question. Do you want separate variables in the timetable for start_time and stop_time? What is the height of samples1? Are you ending up a one-row timetable in TT?
Miguel Albuquerque
on 21 Jun 2022
Accepted Answer
More Answers (0)
Categories
Find more on Tables 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!