![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1333700/image.png)
Simevents: entity generator and insert pattern with non periodic sequences
2 次查看(过去 30 天)
显示 更早的评论
I am trying to generate an entity with an specific intergeneration time sequence, and I am not able to make it. The tools helps on generating random and periodic sequences but this is not matchng my requested pattern. This is [0.002 0.016 0.016 0.016...]. The value 0016 remains constant to the end, and the simulation has to be launched for 2 minutes...I supose that there is a way to generate this with Matlab programming, but I not famiiar with this. I have two questions: 1/ Could you please can send me the Matlab Code to generate the sequence? 2/ The root cause...could you please send me some information (links, title for books,...) for get the proper expertise for Matlab coding?
Thanks in advance...
0 个评论
回答(1 个)
Adit Kirtani
2023-3-23
编辑:Adit Kirtani
2023-3-23
Hi José,
For your first question, if you have a sequence of values from which you wish to set an intergeneration time, you can use the "Event Actions Assistant".
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1333700/image.png)
You can set your desired sequence and modify the if condition after the sequence definition to ensure the sequence always checks the second index (which in your case is the value of 0.016). By default, it is set to return to the first index.
if idx > numel(SEQ)
idx = 2;
end
As for learning MATLAB, a good resource to learn MATLAB programming would be to complete the MATLAB Onramp. You can view the course here:
I hope this helps,
Adit Kirtani.
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!