How to convert a vehicle log with *.blf extension to a timetable/timeseries?

조회 수: 3 (최근 30일)
bülent ünver
bülent ünver 2024년 4월 25일
답변: Abhinav Aravindan 2024년 9월 19일
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

답변 (1개)

Abhinav Aravindan
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!

카테고리

Help CenterFile Exchange에서 Vehicle Network Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by