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!