parallel computing for simulink model, which used global variable
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Programmatic Model Editing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!