hi. i have a matlab code that it opens the simulinkmodel and the simulink model contains blocks and sensors related to unreal engine .

2 views (last 30 days)
I am trying to control and change the position of a car according to sensor data. The biggest problem is that Unreal Engine crashes a lot. I have a 150-line code in my program. The data received in the workspace is correct, but the car animation is not working properly. There is no error during execution. I use the simin and simout to connect Simulink and the script. The main codes are written in the script. What should I do to solve this and see the result? My laptop is an Asus with a Core i7 processor. Everything else works fine, but the 3D animation only works once out of every 10 runs. Sorry for the grammatical mistakes in my question

Answers (1)

Shaunak
Shaunak on 25 Apr 2025
Hi Mahsa,
The error you’re experiencing usually occurs due to a mismatch between the vehicles defined in Simulink and those present in the Unreal Engine scene.
You can try the following troubleshooting steps:
  • Delete all vehicles or any unused vehicles in your Unreal Engine scene. This often resolves crashes that happen when Simulink attempts to control vehicles that do not exist or are not properly set up in Unreal Engine.
  • If this does not resolve the issue, create a simple Simulink model and test it with a new, basic Unreal Engine scene. This approach can help you isolate whether the problem is with your main model/script or with the integration between Simulink and Unreal Engine.
  • Also, make sure your Simulink, Unreal Engine, and related plugins are all compatible, and check for any timing or sync issues between the two programs.
You can refer to the following documentation for more information on using Unreal Engine with Simulink:
Hope this helps!

Community Treasure Hunt

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

Start Hunting!