How do I get the time of an event in Matlab from a SimEvent model?

1 view (last 30 days)
Hi,
How can I write the times and values of an event-based signal to the MATLAB workspace (<http://au.mathworks.com/help/simevents/ug/sending-data-to-the-matlab-workspace.html#bp8t04i>) when I am running the simulation from Matlab?
Here is my code:
clc clear all close all
Period = 0; p=1;
for i=1:1;
Period=Period+1;
simOut= sim('concreting1','SaveOutput','on',...
'SaveTime','on','TimeSaveName','tout',...
'SaveState','on');
z = simOut.get('WaitingInQueue')
r= simOut.get('Pump')
t=simOut.get('tout')
p=p+1;
end
and my model:
the r give me the number of entity that left the server and t give me the simulation time not the time of the signal. I need the former.

Answers (0)

Categories

Find more on Discrete-Event 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!