Filter löschen
Filter löschen

Acces workspace of model using sim command in parfor loop

1 Ansicht (letzte 30 Tage)
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)

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 15 Dez. 2012
assignin('base', 'var',value)
  1 Kommentar
Bert Van den Zegel
Bert Van den Zegel am 16 Dez. 2012
Bearbeitet: Bert Van den Zegel am 16 Dez. 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...

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by