Loading a DAGNetwork file from the workspace to Simulink
13 views (last 30 days)
Pratyush Roy on 27 Jul 2021
Getting a deep network into Simulink in R2020a requires the use of Legacy Code Tool and S-functions. In order to make sure you have the appropriate support packages, you can install both of these:
Then, you can refer to this workflow:
for an example of how to get the 'detect_lane' function into Simulink. You can replace 'detect_lane' with a function which executes your neural network to import it into Simulink.
If you are interested in trying out the updated workflows in R2020b, you can simply load your deep networks as-normal from inside a MATLAB Function block. For example, to load YOLO inside a function block in R2020b, I would simply execute:
detectionnet = coder.loadDeepLearningNetwork('yolo_tsr.mat','Detection');
The net is declared as persistent to ensure we do not load the net repeatedly each time the block is executed.
Hope this helps!