Borrar filtros
Borrar filtros

Acces workspace of model using sim command in parfor loop

1 visualización (últimos 30 días)
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)

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Environment Customization en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by