Simulink setConfig showing error while Updating References for each worker in parallel parfor
5 ビュー (過去 30 日間)
古いコメントを表示
I am running Simulink Model, which is set to Never Rebuild, in parfor.
Looks like setConfig is showing error with Simulink Model References are being updated.
This is resulting in following error:
Error using Simulink.fileGenControl A build is in progress. During a build the only actions allowed are:
'getConfig'
'get'
Error in Simulink.fileGenControl
Note:
It's required to define CacheFolder & CodeGenFolder for each run although its a same folder.
Code Outline:
% Running first time to create slprj folder
buildFolder = 'C:\Users\Documents\Work\temp';
cfg = Simulink.fileGenControl('getConfig');
cfg.CacheFolder = buildFolder;
cfg.CodeGenFolder = buildFolder;
Simulink.fileGenControl('setConfig', 'config', cfg);
open_system('Simulink_Model')
sim('Simulink_Model')
parfor i=1:3
buildFolder = 'C:\Users\Documents\Work\temp';
cfg = Simulink.fileGenControl('getConfig');
cfg.CacheFolder = buildFolder;
cfg.CodeGenFolder = buildFolder;
Simulink.fileGenControl('setConfig', 'config', cfg);
open_system('Simulink_Model')
sim('Simulink_Model')
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deep Learning with Simulink についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!