parallel computing for simulink model, which used global variable
조회 수: 10 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!