Azzera filtri
Azzera filtri

Acces workspace of model using sim command in parfor loop

1 visualizzazione (ultimi 30 giorni)
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)

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 15 Dic 2012
assignin('base', 'var',value)
  1 Commento
Bert Van den Zegel
Bert Van den Zegel il 16 Dic 2012
Modificato: Bert Van den Zegel il 16 Dic 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...

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Simulink Environment Customization in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by