Effacer les filtres
Effacer les filtres

Acces workspace of model using sim command in parfor loop

1 vue (au cours des 30 derniers jours)
Bert Van den Zegel
Bert Van den Zegel le 15 Déc 2012
I want to acces the workspace of a model I'm running with the sim comment. I want to set a parameter with assigning or setparam. How can I refer to that workspace? (this should all be performed insite a parfor loop that executes the external model several times with this parameter changing every time the loop is executed)

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 15 Déc 2012
assignin('base', 'var',value)
  1 commentaire
Bert Van den Zegel
Bert Van den Zegel le 16 Déc 2012
Modifié(e) : Bert Van den Zegel le 16 Déc 2012
Doesn't that assign the variable to the main workspace? It has to be assigned to the workspace of the model that's going to be called with a sim comment. Code shoud be something like:
parfor i=1:N
assign i to a constant block in externalmodel
[t,x,y1,y2] = sim(external model,[starttime,stoptime]
Y1=[Y1 y1];
Y2=[Y2 y1];
end
But whatever I try, it either can't find the constant block, has transparancy errors...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Environment Customization 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!

Translated by