#include<iostream>
#include<string>
#include"mat.h"
#pragma comment(lib,"libmx.lib")
#pragma comment(lib,"libmat.lib")
using namespace std;
int main
{
MATFile *pMatFile=NULL;
mxArray *pMxArray=NULL;
pMatFile=matOpen("824.mat","r");
pMxArray=matGetVariable(pMatFile,"m");
//dMat1=(double*)mxGetData(pMxArray);
size_t paa=mxGetM(pMxArray);//矩阵行数
size_t pbb=mxGetN(pMxArray);//矩阵列数
double *p=mxGetPr(pMxArray);
//for(int m=0;m<64;m++)
//cout<<*(p+m)<<" ";
cout<<paa<<" "<<pbb<<endl;
system("pause");
return 0;
}
每次运行都报错:paa未声明标识符,我明明声明了啊
------解决方案--------------------------------------------------------
int main()//括号都少了
{
...
}