How to use real time input from workspace in Simulink

조회 수: 2 (최근 30일)
Jorrit
Jorrit 2014년 6월 15일
댓글: tq yu 2019년 5월 15일
I want to use Simmechanics to visualize the motion of a complex mechanical system with various joints. I want to use external input to drive some of the joints and be able to view the motion that the system will have in real-time. The input for my model is made by a separate system and written in a specific file format which I cannot change.
I need to import the data in my workspace and then stream it to the simmechanics model.
As a test case, I made a simple model. To start, I want to be able to just type in a number in the workspace; in this case an angle of one of the joints; and view the motion in the simmechanics model. So when I type simin = 45, a bar will move to an angle of 45 degrees. I'm not using any timesteps or time vectors or similar. It just needs to update to the latest value. To simulation needs to run infinitely an when the data in the workspace is updated, use that data.
Which function do I need to use to get real-time data from the workspace into Simulink? Simin only seems to take a time based vector, with pre-determined inputs.
  댓글 수: 1
tq yu
tq yu 2019년 5월 15일
If you have solved it , please help me out . Thank you a lot

댓글을 달려면 로그인하십시오.

답변 (1개)

tq yu
tq yu 2019년 5월 15일
hi ,there ,have you solved the problem?I just encounter the similar issue .Below is the similar QS by onther ,wish to help you.
https://stackoverflow.com/questions/37180724/run-a-continuous-simulink-model-with-real-time-input

카테고리

Help CenterFile Exchange에서 Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by