How do I prepare a MDF Datastore for training a neural Network? (Deep Network Designer)

24 次查看(过去 30 天)
Hi there,
I want to build a neural network that predicts certain quantities of a cars dynamics. To keep it simple, let's say I want to predict the cars acceleration depending on the throttle position. I have a lot of mf4 files of the car driving around, containing data of the throttle position and the acceleration. I import them using mdfRead
How do I prepare the data so that I can load it into the Deep Network Designer?
I basically have two problems: The files contain a lot of quantities (aka channels) that I don't need and the channels I need are in different channel groups.
What I tried so far is to follow this guide: https://de.mathworks.com/help/vnt/ug/write-channel-group-data-from-existing-mdf-file-to-new-mdf-file.html which basically copies all the needed channels into a new timetable and saves that as a new mdf file. The problem is that the channels use different sampling rates and therefore the timetables have different sizes and I get "Error using . To assign to or create a variable in a table, the number of rows must match the height of the table."
Whats the best way to fix that or is my approach complete nonsense?

回答(1 个)

Sanjana
Sanjana 2024-9-23,12:00
Hello,
I understand that you have two timetables with data collected at different sampling rates, there by there is a difference in the no. of rows in two timetables.
In order to combine such data, you can use "synchronize" function to combine timetables with different row times and timetable variables.
"synchronize" function can be used to fill in missing elements of the combined output timetable using interpolated values by selecting the suitable interpolation method.
Kindly, refer to the following code for more information,
%consider throttleData & acceleration are two timetables
%newTimeBasis has to be specified based on the required row times of the
%output timetable
combinedData = synchronize(throttleData,acceleration,'last','linear');
%create a new MDF file with combinedData
mdfCreate('combinedData.mf4');
mdfWrite('combinedData.mf4',combinedData);
%create MDF datastore with combined data
mdfds = mdfDatastore("combinedData.mf4");
Please, refer to the following documentation for more information,
Regards,
Sanjana

Community Treasure Hunt

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

Start Hunting!

Translated by