Why do I get a build error when generating a code for model containing stateflow in MATLAB 2011b "error calling s generated S function" ?
1 次查看(过去 30 天)
显示 更早的评论
Why do I get a build error when generating a code for model containing stateflow "error calling s generated S function" ?
Model simulates properly, when build system to generate code is selected the following error is got in MATLAB 2011b. The model has a stateflow and I'm taking a guess its because of this.
Error recieved is : Error calling generated Sfunction, model_sfun. Undefined function 'model_sfun' for input arguments of type 'double'
0 个评论
回答(1 个)
Gerhard Feichtinger
2015-7-8
I just had the same error in 2015a, and it seems to be because I was setting the Simulink CodeGenFolder and CacheFolder parameters to nonstandard values. I'm not sure if there's a similar StateFlow value to set, but commenting out these lines from my setup file fixed the issue. So maybe it's something that you set up for Simulink that Stateflow is expecting in a different location?
% Simulink.fileGenControl('set', 'CacheFolder', [userpath '/_code_dummy_'], 'createDir', true)
% Simulink.fileGenControl('set', 'CodeGenFolder', [userpath '/_code_dummy_'], 'createDir', true)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!