how to send Data to workspace

6 views (last 30 days)
How to send data to workspace continuosly whenever my simulink model has been paused by below code,,I am using a simple constant block and to workspace block
tic
open_system('');
for i=1:1:10
set_param('SampleTest','StopTime', sprintf('%d',i));
set_param('SampleTest', 'Simulationcommand', 'start')
pause(1)
set_param('SampleTest', 'Simulationcommand', 'update')
set_param('SampleTest', 'Simulationcommand', 'continue')
end
toc
  2 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 8 Jan 2013
Do you mean after 10, itterations?

Sign in to comment.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 7 Jan 2013
Please see the second paragraph in my answer here for an explanation of what you're seeing. If you'd like your workspace to be updated immediately, you might need to write your own MATLAB code to do this. You can follow the technique described in Access Block Data During Simulation to run your MATLAB code as soon as a new output value becomes available.
  1 Comment
Arun Badigannavar
Arun Badigannavar on 11 Jan 2013
I have found the solution,,,I avoided paassing variables value to workspace,,,rather am directly calling the values to next model wher i require them,,thanks for ur help i learnt usefull things

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!