![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1447957/image.png)
Receiving an expected '='... error when trying to embbed simple C code in matlab2015
2 ビュー (過去 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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1447957/image.png)
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!