Is there any way to disable code generation in Simulink
78 次查看(过去 30 天)
显示 更早的评论
Hi,
I have my own matlab function which I have entered into Simulink as MATLAB Function Block. I use design.lowerpass filter in it as well as other functions that Simulink Coder does not support. I don't want to generate C code for my Simulink model I just want to perform simulations and want Matlab to interpret my function. Is there any way to tell Simulink not to generate code? There seem to be no option to have no target is Simulink. What will happen if I remove Simulink Coder from my path? All the help files are full of how to generate code but none tell how not to generate it.
Regards
Adam
0 个评论
采纳的回答
Guy Rouleau
2013-5-6
Wrap your whole script in a separate MATLAB-file and make it extrinsic so that your MATLAB Function code look like:
%%% function y = myEMLblock(u) coder.extrinsic myWrapper
y = mywrapper(u); %%%
Then put any code you want inside the your wrapper function mywrapper.m
5 个评论
Rafael Cordero
2020-10-17
I'm not sure I undestand this answer.
So, the idea is to take the Matlab Function block (or is it the interpreted Matlab function block?) and in that block write:
%%% function y = myEMLblock(u) coder.extrinsic myWrapper
y = mywrapper(u); %%%
Then, inside the mywrapper() function is where I put my code I actually want to run (without C code-generation).
Is that correct? Wont the %%% comment out the first line and make it useless? If I try this with the Matlab Function block, as soon as I save the block code, it inserts the generic y = function u in the first line.
更多回答(2 个)
Gijs van Oort
2013-5-6
Have a look at the coder.extrinsic function within you %codegen'ereated function.. Otherwise, you could try to use the 'interpreted matlab function' and call your self-written m-file which does what you want. (note that the terminology on these user-defined functions has changed somewhere between Matlab2010 and 2012, so have a wide look around in the User-defined functions if you cannot find the adequately named block.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Design 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!