MATLAB Answers


How to use real time input from workspace in Simulink

Asked by Jorrit
on 15 Jun 2014
Latest activity Commented on by tq yu
on 15 May 2019
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 Comment

If you have solved it , please help me out . Thank you a lot

Sign in to comment.

1 Answer

Answer by tq yu
on 15 May 2019

hi ,there ,have you solved the problem?I just encounter the similar issue .Below is the similar QS by onther ,wish to help you.


Sign in to comment.