how to send Data to workspace

조회 수: 1 (최근 30일)
Arun Badigannavar
Arun Badigannavar 2013년 1월 7일
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
Arun Badigannavar
Arun Badigannavar 2013년 1월 7일
I am trying this but data will come to base workspace oly after my code finishes 10 steps
Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 8일
Do you mean after 10, itterations?

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

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 1월 7일
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
Arun Badigannavar
Arun Badigannavar 2013년 1월 11일
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

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by