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 const mxArray *array_ptr;
00020 char *variable;
00021 mxLogical *pl;
00022
00023
00024 if (nrhs != 1) {
00025 mexErrMsgTxt("One input argument required.");
00026 }
00027 if(nlhs > 1){
00028 mexErrMsgTxt("Too many output arguments.");
00029 }
00030
00031
00032 if (!(mxIsChar(prhs[0]))){
00033 mexErrMsgTxt("Input must be of type string.");
00034 }
00035
00036
00037 variable= mxArrayToString(prhs[0]);
00038 array_ptr = mexGetVariablePtr("caller", variable);
00039 if (array_ptr == NULL){
00040 mexErrMsgTxt("Could not get variable.\n");
00041 }
00042
00043 plhs[0] = mxCreateLogicalMatrix(1,2);
00044 pl = mxGetLogicals(plhs[0]);
00045
00046 pl[0] = mxIsLogical(array_ptr);
00047 pl[1] = mexIsGlobal(array_ptr);
00048
00049 mxFree(variable);
00050 }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060