how to send Data to workspace
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!