如何使用MATLAB code转换后m文件?
浏览:932 回答:1
我用MATLAB code将一个m文件变成c文件,在visual studio2012上面却运行不了,怎么回事?
m文件1 test
function [a,b]=jiafa(x,y)
a=2*x+y;
b=3*y;
end
m文件2 main
[a,b]=jiafa (1,3)
转换后的c文件
//test #include "rt_nonfinite.h" #include "jiafa.h" void jiafa(double x, double y, double *a, double *b) { *a = 2.0 * x + y; *b = 3.0 * y; }
#include "rt_nonfinite.h" #include "jiafa.h" #include "main.h" #include "jiafa_terminate.h" #include "jiafa_initialize.h" static double argInit_real_T(); static void main_jiafa(); static double argInit_real_T() { return 0.0; } static void main_jiafa() { double b; double a; jiafa(argInit_real_T(), argInit_real_T(), &a, &b); } int main(int, const char * const []) { jiafa_initialize(); main_jiafa(); jiafa_terminate(); return 0; }