#include <stdio.h>#include <string.h>#include <matrix.h>#include <mex.h>#include "grpc.h"#include "matlab_gs.h"
Go to the source code of this file.
Functions | |
| void | matlab_gs_get_last_error (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) |
Matlab client call
Definition in file matlab_gs_get_last_error.c.
| void matlab_gs_get_last_error | ( | int | nlhs, | |
| mxArray * | plhs[], | |||
| int | nrhs, | |||
| const mxArray * | prhs[] | |||
| ) |
Return the error_code for the last error in the right hand side by calling grpc_get_last_error.
| nlhs | - Number of left hand side arguments from Matlab | |
| plhs | - Pointer to left hand side arguments from Matlab | |
| rlhs | - Number of right hand side arguments from Matlab | |
| plhs | - Pointer to right hand side arguments from Matlab |
Definition at line 30 of file matlab_gs_get_last_error.c.
{
int i;
if ((nlhs != 1)||(nrhs != 1)) {
mexErrMsgTxt("Usage: num = gridsolve_errno\n");
goto error;
}
plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL);
/* Use Matlab global error number */
mxGetPr(plhs[0])[0] = (double)matlab_gs_error_num;
return;
error:
for (i=0;i<nlhs;i++) plhs[i] = mxCreateDoubleMatrix(0,0,mxREAL);
mexPrintf("Warning: GridSolve call failed: %d:%d: %s; %s\n", grpc_errno, grpc_minor_errno, grpc_error_string(grpc_errno), grpc_minor_error_string(grpc_minor_errno));
return;
}


1.6.3-20100507