Exchange data between a running Matlab script and Simulink
1 view (last 30 days)
Show older comments
We are students trying to autonomously run a RC car along a pre determined circuit.
The problem we are facing now is the following: We would like to control the car through Simulink (the car is running ROS) and at the same time run a Matlab script that exports its data to Simulink.
The Matlab script receives data from a motion capture system, which is then needed to locate and control the car in Simulink. We tried to use a Matlab function block, but there are commands (like addpath, fullfile) that are not supported in this case.
We are running on Windows.
Does anyone know if it is possible?
0 Comments
Accepted Answer
Ameer Hamza
on 8 May 2018
Edited: Ameer Hamza
on 8 May 2018
An easier way is to add a new topic to your system. Create a subscriber in your Simulink model which is listening to data from a specific topic. Then add a publisher of the same topic in your MATLAB script. In that way, the MATLAB script can publish data which then can be received by the subscriber in Simulink and use in processing.
More Answers (0)
See Also
Categories
Find more on Block Libraries in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!