我在 test.c 中创建了一个 C 函数
#include <stdio.h>
int Test()
{
FILE * fp = fopen("C:\\workspace\\test.txt", "rw");
fprintf(fp, "test hello world");
fclose(fp);
return 10;
}
我在 simulink 的状态流中定义了一个状态。我用了
en: Test();
我在 Tools->Open Simulation Target->Custom Code->Include List of Additional 和 Include Custom C Code in generated(使用绝对路径和文件名)中指定了文件当我尝试运行模型时,出现解析器错误: zh: 测试(); ^ 名为“Test”的函数不是 Stateflow 函数。
我该怎么办?