Simulink output matrix in real time

Hello everyone, I try to use Simulink to output matrix recorded in workspace in real time.
For example, my matrix is 4*6 matrix.
The first second, the output is first row of my matrix, which is 1*6 matrix.
The second second, the output is second row of my matrix, which is 1*6 matrix.
...
Until every row in my matrix is finished to be read.
Does anyone know how to realize it? Any ideas is appreciated!!

4 Comments

Outputing to the workspace implies that something is running that could read it, but Simulink keeps running unless you ask for it to pause. What were you hoping to be able to do with the variable written in real time?
I have file including many data. I want to output line by line to my robot, each line is one piece of action of my robot. If I could output it line by line in real time, my robot will show the whole action regarding to the data.
Could you give me some ideas which I could use in Simulink to output line by line in real time? Suppose I set the period is 1s.
The robot would not be able to read the data from the workspace until Simulink stopped running. If you have the I/O for the robot running in a parallel thread then the data would have to be sent to that parallel thread, which can be done by a MATLAB Function Block
You should be considering using the Robotics toolbox to send messages to the robot, or using the a MATLAB Function Block to fprintf() to the device the robot is listening on.

Sign in to comment.

Answers (0)

Asked:

on 18 Sep 2017

Commented:

on 19 Sep 2017

Community Treasure Hunt

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

Start Hunting!