parallel computing for simulink model, which used global variable

조회 수: 10 (최근 30일)
lingyan
lingyan 2013년 7월 10일
Hallo all, i wrote a parfor loop, and in the parfor loop a simulink model is called, but this simulink model uses many global variable. And when this model is called, exits a error "Undefined function or variable 'CYCLE'". This CYCLE is a global variable and should be used in Simulink model. Do you have any suggestions? Thanks a lot!
parfor
....
[f_left, con_left, fflag_left] = CallObjFcn(Problem,a,b,calltype,varargin{:});
....
end
function [fcn_value, con_value, feas_flag] = CallObjFcn(Problem,a,b,calltype,varargin)
load('C:Documents\MATLAB\V1Par - Copy\Simulation_Daten');
......
[fcn_value,feas_flag] = feval(Problem.f,point,varargin{:});
......
end
Problem.f = 'gp_con';
function [value,fflag] = gp_con(x)
......
sim('XRSimWWPen01');
......
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by