#include "mex.h"
#define DWORD long
#define NUMBER_OF_STRUCTS (sizeof(friends)/sizeof(struct phonebook))
#define NUMBER_OF_FIELDS (sizeof(field_names)/sizeof(*field_names))
void mexFunction(int nlhs,
mxArray * plhs[] , int nrhs,const mxArray * pahs[])
{
typedef struct {
DWORD dt; //日期: 比如读出数据为20031110,代表2003年11月10号
DWORD k_price;//开盘价*0.01():读出的价格乘0.01为实际价格。下同。
DWORD h_price;//最高价*0.01
DWORD l_price;//最底价*0.01
DWORD s_price;//收盘价
float s_tolmoney;//(单位:亿)
DWORD bur_tol;//成交量
DWORD unknown; ///没有使用
}ST_K_DATE;
FILE * f = 0;
int nfieldidx= 0;
char * pkdata;
int lday = 8;
int dims[2] = {1, lday };
char msg[128] = "";
char path[512] = {0};
int i,r,c ,*val;
double *kp,*sp,*hp,*lp,*tm,*vol;
int lseekpos;
mxArray *field_value;
const char *field_names[] = {"日期", "开盘价","最高价","最低价","收盘价","成交金额","成交量"};
ST_K_DATE * pd = 0;
r = mxGetM(pahs[0]);
c = mxGetN(pahs[0]);
sprintf(msg,"r:%d , c:%d rn",r,c);
mexPrintf(msg);
mxGetString(pahs[0],msg,128);
sprintf(path,"D:\jcb_hxzq\vipdoc\sh\lday\sh%s.day",msg);
me