static char mc_version[] = "MATLAB Compiler 1.2.1 Jan 21 1999 infun"; /* * MATLAB Compiler: 1.2.1 * Date: Jan 21 1999 * Arguments: -Z -i -r behelp */ #ifndef ARRAY_ACCESS_INLINING #error You must use the -inline option when compiling MATLAB compiler generated code with MEX or MBUILD #endif #ifndef MATLAB_COMPILER_GENERATED_CODE #define MATLAB_COMPILER_GENERATED_CODE #endif #include #include "mex.h" #include "mcc.h" /***************** Compiler Assumptions **************** * M-File: /amd/ir6/w/fyz/2dd/behelp.m * * I0_ integer scalar temporary * I1_ integer scalar temporary * I2_ integer scalar temporary * IM0_ integer vector/matrix temporary * a1x real vector/matrix * a1y real vector/matrix * behelp * c1 real vector/matrix * d real scalar * dmin real scalar * e1x real vector/matrix * e1y real vector/matrix * j integer scalar * k integer scalar * kmin integer scalar * l1 real vector/matrix * length * zeros *******************************************************/ void mexFunction( int nlhs_, mxArray *plhs_[], int nrhs_, const mxArray *prhs_[] ) { if (nrhs_ > 4 ) { mexErrMsgTxt( "Too many input arguments." ); } if (nlhs_ > 2 ) { mexErrMsgTxt( "Too many output arguments." ); } mcmSetLineNumber(0); { mxArray e1x; mxArray e1y; mxArray a1x; mxArray a1y; mxArray l1; mxArray c1; int j = 0; double dmin = 0.0; int k = 0; double d = 0.0; int kmin = 0; int kmin_flags_ = 0; int I0_ = 0; int I1_ = 0; int I2_ = 0; mxArray IM0_; mccRealInit(a1x); mccImport(&a1x, ((nrhs_>0) ? prhs_[0] : 0), 0, 0); mccRealInit(a1y); mccImport(&a1y, ((nrhs_>1) ? prhs_[1] : 0), 0, 0); mccRealInit(l1); mccImport(&l1, ((nrhs_>2) ? prhs_[2] : 0), 0, 0); mccRealInit(c1); mccImport(&c1, ((nrhs_>3) ? prhs_[3] : 0), 0, 0); mccRealInit(e1x); mccRealInit(e1y); mccIntInit(IM0_); /* e1x=zeros(length(a1x),1); e1y=zeros(length(a1x),1); */ if(mccNOTSET(&a1x)) { mexErrMsgTxt( "variable a1x undefined, line 3" ); } I0_ = mccGetLength(&a1x); mccZerosMN(&e1x, I0_, 1); I0_ = mccGetLength(&a1x); mccZerosMN(&e1y, I0_, 1); /* for j=1:length(a1x), */ I1_ = mccGetLength(&a1x); for (I0_ = 1; I0_ <= I1_; I0_ = I0_ + 1) { j = I0_; /* dmin=10000; */ dmin = 10000; /* for k=1:l1, */ if(mccNOTSET(&l1)) { mexErrMsgTxt( "variable l1 undefined, line 6" ); } for (I2_ = 1; I2_ <= *mccPR(&l1); I2_ = I2_ + 1) { k = I2_; /* d=(a1x(j)-c1(k,1))^2+(a1y(j)-c1(k,2))^2; */ if(mccNOTSET(&c1)) { mexErrMsgTxt( "variable c1 undefined, line 7" ); } if(mccNOTSET(&a1y)) { mexErrMsgTxt( "variable a1y undefined, line 7" ); } if(mccNOTSET(&c1)) { mexErrMsgTxt( "variable c1 undefined, line 7" ); } d = (mcmRealPowerInt(((mccPR(&a1x)[(j-1)]) - (mccPR(&c1)[(1-1)*mccM(&c1) + (k-1)])), 2) + mcmRealPowerInt(((mccPR(&a1y)[(j-1)]) - (mccPR(&c1)[(2-1)*mccM(&c1) + (k-1)])), 2)); /* if d