Receiving an expected '='... error when trying to embbed simple C code in matlab2015
1 次查看(过去 30 天)
显示 更早的评论
Hello everyone, I am trying to run a simulation in simulink using a piece of code in C. I was following This matlab tutorial using matlab function block but although it worked in matlab2023, in 2015r it doesn't. I receive a ...callingDoubleIt_sfun.c:9:9 error: expected '=', ',', ';', 'asm' or '_attribute_' berfore '.' token. My code is directly pasted from matlab tutorial. I trid another simulation with a different code but the result is the same. Anyone knows what is happening or a simple way to run a simple C code that doesn't require all the additional declarations i've found with S functions examples?
0 个评论
回答(1 个)
Keshav
2023-8-2
I think by mistake you have added sourcefile name in "Include custom C code in generated" category instead of "Include list of additional" category. Look at the below image for correct reference.
The documentation you see on the MathWorks website is related to the latest release. If you are working with the older version of MATLAB then it is advisable to refer to the documentation specific to that particular version.
To access the documentation for "Integrate C Code Using the MATLAB Function Block" in MATLAB R2015, kindly execute the following command in your MATLAB R2015 command window:
web(fullfile(docroot,'simulink/ug/incorporate-c-code-using-a-matlab-function-block.html'))
This will provide you with the relevant documentation for your version of MATLAB.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!