Create a time table
显示 更早的评论
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 个评论
Eric Sofen
2022-6-21
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
2022-6-21
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!