Find same temperature for each days
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I am using MATLAB 2020b and I would like to find same temperature in night for each days. I am reading data by readtable. This code is for finding data in night from 00:00 to 7:00 oclock morning.
T2 = getappdata(app.UITable, 'Data');
TT = table2timetable(T2); %Convert table to timetable
filtertime1 = app.TimestartEditField.Value; %Get value from EditField
TimeStart = duration(filtertime1,'Format','hh:mm'); %Convert data from EditField to duration of time
filtertime2 = app.TimeendEditField.Value; %Get value from EditField
TimeEnd = duration(filtertime2,'Format','hh:mm'); %Convert data from EditField to duration of time
pickStartTime = TT.DATE_(:);
timeStartExcel = timeofday(pickStartTime);
idx = (timeStartExcel >= TimeStart) & (timeStartExcel < TimeEnd);
T2 = TT(idx,:);
But here, I need to find same temperature, I tryed use unique but it doesnot find same temperature for each days.
[C,IA,IC] = unique(T2.M01__C);
B = T2(IA,:);
Temperature = retime(B,'daily');
Or is it there some option how to use for cycle? Like I have start point for example temperature 22,0°C and I will compare for each days that is it same?
count = 0;
for i = 1:numel(T2)
temperature(i) = 22,00 + i;
if T2.M01__C(i,1) == temperature;
count = count +1;
end
end
Temperature_matlab is file with data I am using. This file is just as an example, the same temperature for each days is 18,05 ° C. I would like to find if the same temperature for each days exist or if doesnot which temperature will be most common and which days it will be.
6 件のコメント
Mario Malic
2020 年 10 月 26 日
編集済み: Mario Malic
2020 年 10 月 26 日
Comments can't be accepted as an answer. I posted a brief reply that you can accept. Thanks in a advance, have a great start of the week!
採用された回答
Mario Malic
2020 年 10 月 26 日
編集済み: Mario Malic
2020 年 10 月 26 日
See discussion in the comments section, groupcounts function works well with data in the table.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dates and Time についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!