Using SimEvents results in Matlab
조회 수: 1(최근 30일)
표시 이전 댓글
Zahra Moussavi 2016년 1월 28일
댓글: Zahra Moussavi 2016년 2월 2일
I want to change a parameter from 1 to 60 (1:1:60) in SimEvents and run the simulation. I might need to that for other parameters too so I thought of using a for loop in Matlab to do that. I used the "To Workspace block" to export my simulation results into the worksapce and when I run my simulation it is working and I can see the results being stored in an array. But the problem is when I use the for loop in Matlab to run the simulation then I get an error and it is not working. Any idea that why is it working when I run the simulation model itself and it's not when I run it from the Matlab environment?
Here is my simple code in Matlab:
Period = 0;
That's is the warning that I get:
Reference to a cleared variable simout.
Error in IntervalChange (line 10)
That's the to workspace block in my simulation model:
and it is actually working when I run it from the SimEvents environment:
댓글 수: 0
Sean de Wolski 2016년 1월 29일
Assign the output of sim to simOut.
simOut = sim('concreting1', 'SaveOutput','on');
z = simOut.get('Finaloutput'); % Finaloutput being the name of the output you want
댓글 수: 2
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!