Is there a way to pass variables from SimEvents to Simulink while the simulation is running?
5 次查看(过去 30 天)
显示 更早的评论
I was wondering if there is a way to pass variables from a SimEvents based system to a Simulink based system. Right now I have a two separate systems which use a set of shared global variables. But these are not adjustable once the simulation starts running. Is there a way to define variables in the SimEvents system and pass them into the Simulink system so that I can change certain variables during the simulation?
1 个评论
Teresa Hubscher-Younger
2015-10-12
I might not be understanding exactly what you want to do. But if I had some global variables that I wanted to use in the SimEvents system and the pass them into the Simulink system. I would assign them to attributes and pass them out to Simulink as attributes. You would use the Set Attributes block to assign the value and then the Get Attributes block to pull it out and send it as a signal to Simulink, which then can change the variables. But if you already have it as an attribute, you can manipulate it in SimEvents, including by using the MATLAB Attribute Function block. I'm not sure if this is what you were looking for, but I thought it couldn't hurt to throw out an idea.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Discrete-Event Simulation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!