I have read Mf4 file using "vehicle network Toolbox", Now i want to convert this to other formats such as CSV/PCD

33 visualizaciones (últimos 30 días)
i have used this function of tool box to read data,
dataChanTable = mdfRead("VehicleData.mf4", Channel=chanInfo)
>> writetable(data, 'output.csv');
Error using writetable (line 21)
Type 'timetable' is not supported. Use writetimetable instead.

Respuestas (1)

Sumukh
Sumukh el 27 de Sept. de 2024
Hi Rajendra,
The “mdfRead” command reads the .MF4 file and outputs a cell array of timetables. To convert the output “dataChanTable” into .CSV file format, please follow the following steps:
  • The command “writetimetable” can be used to convert one timetable at a time in the cell array “dataChanTable” into .CSV format. You can use the following command:
writetimetable(dataChanTable{1},output.csv) % 1 can be replaced by required index of timetable.
  • To convert multiple timetables into multiple .CSV files, you can use the following for-loop to loop through the timetables and create distinct .CSV files:
for i = 1:length(dataChanTable)
filename = sprintf('output_%d.csv', i);
writetimetable(dataChanTable{i}, filename);
end
You can refer to the following documentation to know more about the “writetimetable” command:
.PCD files are point cloud files representing the coordinates of data-points in 3-D space. It is irrelevant to convert the given data into point cloud files.
I hope this answers the query.

Community Treasure Hunt

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

Start Hunting!

Translated by