Acces workspace of model using sim command in parfor loop

8 次查看(过去 30 天)
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)

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2012-12-15
assignin('base', 'var',value)
  1 个评论
Bert Van den Zegel
Bert Van den Zegel 2012-12-16
编辑:Bert Van den Zegel 2012-12-16
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...

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by