Latest Date Entry Record
조회 수: 8 (최근 30일)
이전 댓글 표시
I have a large data set that contains multiple tests for the same pieces of equipment over many years. How can I isolate the latest test results only for the various pieces of equipment? There is a date stamp and equipment id and test results.
For example, for motor X, what are the last or current oil reports and ignore previous old test.
댓글 수: 2
채택된 답변
KL
2017년 11월 22일
use sortrows,
sortedTable = sortrows(yourTable,'timestampColumnName')
댓글 수: 6
KL
2017년 11월 27일
Alright, you're extracting it for all equipments, so
T_latest = table;
for x=1:height(sortedTable)
T1 = sortrows(sortedTable(sortedTable.position_id==x,:),'sampledt_MAIN');
T_latest = [T_latest; T1(end,:)];
end
now, T_latest should have the last entries corresponding to all x.
추가 답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!