Clear Filters
Clear Filters

How to use real time input from workspace in Simulink

2 views (last 30 days)
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.

Answers (1)

tq yu
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.
https://stackoverflow.com/questions/37180724/run-a-continuous-simulink-model-with-real-time-input

Categories

Find more on Simulation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!