-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the default CPP code different from that in MATLAB official documentation? #2
Comments
It seems not difference. The default code is c-style, but the code in Matlab documentaion which you show is cpp-style. |
I think I have chosen somewhere to use cpp, and the code file itself is cpp. |
Ah, sorry that I never responded to this. The C style default is used if you select Matrix API in the wizard. The Matrix API may be used with either C or C++ code, and is backwards compatible with older versions of MATLAB. Your second example should be the code that is generated if you were to select Data API in the wizard. I hope that helps explain things. |
In fact, i also use cpp, but many people in our country choose to use matlab, so i have to wrap the c/c++ code to matlab/simulink for them. The operation mechanism in simulink is c-style for embeded development. So if your code is c++(object-oriented, OOD), you have to wrap your cpp code with pointer. This warp can be done in a c file or in s-function defination. |
The default code created is like:
But in MATLAB documentation:
The text was updated successfully, but these errors were encountered: