注册 登录
编程论坛 Matlab

VC和MATLAB混合编程求助

vfdff 发布于 2008-06-18 11:13, 897 次点击
大家好,我使用
%函数gau.m:ML量化器设计中分母的计算式%
function y=gau(x)
y=1/sqrt(2*pi)*exp(-x.^2/2);
函数生成了C语言,他对应的头文件是
#ifndef __Gau_h
#define __Gau_h

Mm Gau(Mm x);

#endif // __Gau_h

然后,我编写了个测试程序
使用
#include <stdio.h>
#include "Gau.h"

int main()
{
    printf("%f", Gau(3.4));
    return 0;
}
编译提示错误:
d:\program_files\microsoft visual studio\myprojects\a\ss\gau.h(4) : error C2146: syntax error : missing ';' before identifier 'Gau'
d:\program_files\microsoft visual studio\myprojects\a\ss\gau.h(4) : error C2501: 'Mm' : missing storage-class or type specifiers
d:\program_files\microsoft visual studio\myprojects\a\ss\gau.h(4) : fatal error C1004: unexpected end of file found
这个怎么回事呀?
是不是数据的类型可能有问题
因为我对于这个声明中的 Mm 类型数据不了解,在VC中对应的应该是什么类型的数据
麻烦各位兄弟姐妹抽空给我指点下,谢谢!
1 回复
#2
vfdff2008-06-18 11:27
我现在甚至不使用Gau( )函数也不正确了!
修改如下:

#include <stdio.h>
//#include "Gau.h"

int main()
{
    printf("%f", 2.0);
    return 0;
}
//Gau(3.4)
错误提示如附图
1