How to convert a vehicle log with *.blf extension to a timetable/timeseries?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello,
I am trying to read a sample vehicle log in Matlab 2021B with the code below and convert it into a struct that will be timeseries.
I can read the vehicle log with the blfread function. However, when I try to convert this data to timetable with the j1939ParameterGroupTimetable function, I get the following error. It does not give a warning about which message or signal is problematic. What do you suggest for the solution?
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
----------------------------------------------------------------------------------------------------------------------------
canDB = canDatabase('VCAN.dbc');
BlfInfo = blfinfo('VehicleLOG.blf');
for i = 1:size(BlfInfo.ChannelList,1)
canData = blfread('VehicleLOG.blf', i);
TimeTable = j1939ParameterGroupTimetable(canData, canDB);
SgnTimeTable = j1939SignalTimetable(TimeTable);
FieldMsg = fieldnames(SgnTimeTable);
for j = 1:numel(FieldMsg)
SgnNames = SgnTimeTable.(FieldMsg{j}).Properties.VariableNames;
for k = 1:numel(SgnNames)
SgnName = [FieldMsg{j}, '__', SgnNames{k}];
TEST.(SgnName) = timeseries(SgnTimeTable.(FieldMsg{j}).(SgnNames{k}), seconds(SgnTimeTable.(FieldMsg{j}).Time));
end
end
end
댓글 수: 0
답변 (1개)
Abhinav Aravindan
2024년 9월 19일
I had faced a similar issue before while using the “j1939ParameterGroupTimetable”. However, this issue appears to be fixed in MATLAB R2024a.
Please find attached the related documentation for your reference.
I hope this answers your question!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Vehicle Network Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!