Exchange data between a running Matlab script and Simulink

1 回表示 (過去 30 日間)
WZ
WZ 2018 年 5 月 8 日
コメント済み: Ameer Hamza 2018 年 5 月 16 日
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?

採用された回答

Ameer Hamza
Ameer Hamza 2018 年 5 月 8 日
編集済み: Ameer Hamza 2018 年 5 月 8 日
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.
  2 件のコメント
WZ
WZ 2018 年 5 月 16 日
Thank you for your help. This worked perfectly for us.
Ameer Hamza
Ameer Hamza 2018 年 5 月 16 日
You are welcome.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBlock Libraries についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by