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 CenterFile Exchange에서 Block Libraries에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by