I created a C function in test.c
#include <stdio.h>
int Test()
{
FILE * fp = fopen("C:\\workspace\\test.txt", "rw");
fprintf(fp, "test hello world");
fclose(fp);
return 10;
}
And I defined a state in stateflow of simulink. I used
en: Test();
I specified the file in both Tools->Open Simulation Target->Custom Code->Include List of additional and Include Custom C Code in generated (using absolute path and file name) When I tried to run the model, I got parser error: en: Test(); ^ Function named 'Test' is not a Stateflow Function.
What should I do?