Prev: mexCallMATLAB populating inputs
Next: mexCallMATLAB
From: sakshi j on 23 Jun 2010 09:15 Hi, I'm trying to run the following piece of code: void mexFunction( int nlhs, mxArray *[], int nrhs, const mxArray *prhs[] ) { using namespace libbase; vector <double> y; double *xValues; int i,j; mxArray *value; xValues = mxGetPr(prhs[0]); int rowLen = mxGetN(prhs[0]); int colLen = mxGetM(prhs[0]); y.init(2); y=0; y(1)=3; y(2)=3; printf("the rowlength is=%d",rowLen); value = mxDuplicateArray(prhs[0]); double neigh[] = {3,3}; double *pr; mxArray *p; int nlhs1, nrhs1; mxArray *plhs1[2], *prhs1[2]; nlhs1 = 2; nrhs1 = 2; prhs1[0]=value; prhs1[1] = mxCreateCellMatrix(2, 1); pr = mxGetPr(prhs1[1]); for( i=0; i<=1; i++ ) { pr[i] = neigh[i]; } mxSetCell(*p,1, ); mexCallMATLAB(nlhs1,plhs1,nrhs1,prhs1,"wiener2"); return; } i first run the following: a = im2double(imread('stego.tif'))' Then i compile my mex file. And I recieve the following output with this error: the rowlength is=256the value of neigh is=0.000000the value of neigh is=3.000000??? Error using ==> ones Size vector must be a row vector with real elements. Error in ==> wiener2 at 55 localMean = filter2(ones(nhood), g) / prod(nhood); Can anybody help me in this regard?
|
Pages: 1 Prev: mexCallMATLAB populating inputs Next: mexCallMATLAB |