parallel computing for simulink model, which used global variable

7 vues (au cours des 30 derniers jours)
lingyan
lingyan le 10 Juil 2013
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

Réponses (0)

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by