How to convert a vehicle log with *.blf extension to a timetable/timeseries?
6 次查看(过去 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!