00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "mex.h"
00015
00016 void
00017 mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
00018 {
00019 int i;
00020
00021
00022 mexPrintf("\nThere are %d right-hand-side argument(s).", nrhs);
00023 for (i=0; i<nrhs; i++) {
00024 mexPrintf("\n\tInput Arg %i is of type:\t%s ",i,mxGetClassName(prhs[i]));
00025 }
00026
00027
00028 mexPrintf("\n\nThere are %d left-hand-side argument(s).\n", nlhs);
00029 if (nlhs > nrhs)
00030 mexErrMsgTxt("Cannot specify more outputs than inputs.\n");
00031 for (i=0; i<nlhs; i++) {
00032 plhs[i]=mxCreateDoubleMatrix(1,1,mxREAL);
00033 *mxGetPr(plhs[i])=(double)mxGetNumberOfElements(prhs[i]);
00034 }
00035 }
00036