![](/matlabcentral/answers/uploaded_files/1574467/D925714B-969A-4CF0-A11B-29B68AF7CA4B.jpeg)
How to generate bool type identifier 'true' and 'false' C code
28 次查看(过去 30 天)
显示 更早的评论
I got some Simulink.Parameter with data type boolean in Simulink model, and i m tring to generate C code with Code generater. But everytime i got code such as:
const Boolean_T c_flag = 1;
// or
const Boolean_T c_flag = 0;
however what i want is things like :
const Boolean_T c_flag = true;
// or
const Boolean_T c_flag = false;
// or
const Boolean_T c_flag = Boolean(1);
// or
const Boolean_T c_flag = Boolean(0);
i have tried to set the parameter value to '1', 'true', '=true' or even '=boolean(1)',but nothing works.
is that possible in Code Generater/
0 个评论
回答(2 个)
Brandon Stevens
2024-8-6,15:27
Please see the documentation page below for instructions on how to do this in Embedded Coder under the section titled "Boolean Identifiers"
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!