Simevents discrete-event system documentation does not include some of variable-input syntaxes
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Abdolkarim Mohammadi
le 25 Mai 2019
Commenté : Abdolkarim Mohammadi
le 27 Juin 2019
I noticed that in this example, the WheelEntry method invokes an eventIterate action with just 2 inputs and works just fine, but the documentation page of eventIterate just mentions the syntax with 3 inputs. Is there a general rule for distinguishing the optional inputs of event action functions?
0 commentaires
Réponse acceptée
Krishna Akella
le 24 Juin 2019
Hi Kar,
Unfortunately, to my knowledge, there isn't an easy way to infer the optional arguments. However, the way I infer the optional arguments is to open the base class file 'DiscreteEventSystem.m' and look at the definitions there. So in this case I see the following:
function event = eventIterate(storageId, tag, varargin)
% Define an event to iterate entities of a storage
event = matlab.DiscreteEventSystem.newEvent();
event.type = 'iterate';
event.storage = storageId;
event.tag = tag;
nVarargs = length(varargin);
if nVarargs == 0
return;
elseif nVarargs == 1
event.priority = varargin{1};
else
matlab.system.internal.error(...
'SimulinkDiscreteEvent:MatlabEventSystem:IncorrectArgumentNum',...
'eventIterate');
end
end
So it seems like storageId and tag are mandatory inputs, while priority is optional. I wish the documentation mentioned this.
Warm regards,
Krishna
2 commentaires
Krishna Akella
le 27 Juin 2019
Hi Kar,
Just to let you know, I've asked the documentation staff to clarify this on the documentation page.
Regards,
Krishna
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Discrete-Event Simulation dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!