My understanding about SIMULINK advisor
SIMULINK advisor is there so that modellers do not make silly mistakes that could cause an error in code generation and rapid prototyping. The target is to pass all the models without any warnings so that the code generation activity is smooth.
My problem
I have a model that is currently encountering only one warning message in the code generation advisor. The category is Identify blocks using one-based indexing. I understand what 1 (MATLAB) and 0 (usually in C, Java, etc.) based indexing are. But I am failing to understand why this is popping up all the time. I assume that because my TL is C and C uses 0 based indexing, Code Generation Advisor is suggesting that I check for 1-based indexing. I cannot seem to find out what is wrong.
The problem is coming from a MATLAB func block that I am using in SIMULINK model. Due to confidentiality reason, I cannot put the actual content of the file, but can alter the text and provide a technically identical version of the function that is being reported to have "1-based indexing" issue in the advisor dashboard.
function y = IDENT_TABLE(ID_1_INTERNAL, ID_2_INTERNAL, ID_3_INTERNAL)if ID_3_INTERNAL == 1 y = 1;else y = 0;end
I would really appreciate an explanation 🙂
Thanks in advance,
Best Answer