フィルターのクリア

Wanting to analyze only data taken from days at night from a matrix of data from roughly a week

1 回表示 (過去 30 日間)
I have approximately a weeks worth of data (column 1 is date/time data in 30 second epochs and column two is the corresponding integer value for the date/time). I want to keep the entire data set (specifically date/time) for plotting purposes later on, but I only want to analyze the data in a function from 7pm to 10am on each day. Any recommendations on how to do this?
  4 件のコメント
Rik
Rik 2018 年 7 月 12 日
What code have you tried?
Samantha Wallace
Samantha Wallace 2018 年 7 月 12 日
I've tried many codes but in general the code below follows the format I've been trying most I think. It's pretty messy but I'm just stuck in a rut of how to make this work the way I am needing it to.
idx = strcmp(DT3_30str,{'19:00:15'});
[timeidx_7pm,~] = find(idx == 1);
idx = strcmp(DT3_30str,{'10:00:15'});
[timeidx_10am,~] = find(idx == 1);
for ii = 1:size(timeidx_7pm)
if Sampledata(timeidx_7pm(ii):timeidx_10am(ii))
Sampledata(ii,2) = Sampledata(ii,2);
else
Sampledata(ii,2) = {'DayTime'}; % or equal to rally anything as a place holder so I can still have the datetime value for plotting later
end
end

サインインしてコメントする。

回答 (1 件)

Steven Lord
Steven Lord 2018 年 7 月 12 日
If your time and date data is stored as a datetime array, call hour on that datetime array.

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by