How to convert a vehicle log with *.blf extension to a timetable/timeseries?
3 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Abhinav Aravindan
on 19 Sep 2024
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 Comments
See Also
Categories
Find more on Vehicle Network Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!