Changeset 154 for trunk/src/matlab/rpUnitsGetBasis.cc
- Timestamp:
- Jan 11, 2006 3:55:15 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpUnitsGetBasis.cc
r141 r154 3 3 * INTERFACE: Matlab Rappture Library Source 4 4 * 5 * [unitsHandle ] = rpUnitsGetBasis(unitsHandle)5 * [unitsHandle,err] = rpUnitsGetBasis(unitsHandle) 6 6 * 7 7 * ====================================================================== … … 16 16 #include "RpMatlabInterface.h" 17 17 18 /**********************************************************************/ 19 // METHOD: [basisHandle,err] = rpUnitsGetBasis(unitHandle) 20 /// Return a handle to the basis of the provided instance of a Rappture Unit. 21 /** 22 * Retrieve the basis of the Rappture Units object with the handle` 23 * 'unitHandle'. Return the handle of the basis if it exists. If there` 24 * is no basis, then return a negative integer. 25 * Error code, err=0 on success, anything else is failure. 26 */ 27 18 28 void mexFunction(int nlhs, mxArray *plhs[], 19 29 int nrhs, const mxArray *prhs[]) … … 24 34 int retHandle = 0; 25 35 int unitsHandle = 0; 36 int err = 1; 26 37 27 38 /* Check for proper number of arguments. */ 28 39 if (nrhs != 1) 29 40 mexErrMsgTxt("Two input required."); 30 else if (nlhs > 1)41 else if (nlhs > 2) 31 42 mexErrMsgTxt("Too many output arguments."); 32 43 33 unitsHandle = getIntInput(prhs[ 1]);44 unitsHandle = getIntInput(prhs[0]); 34 45 35 46 /* Call the C subroutine. */ … … 42 53 if (myBasis) { 43 54 retHandle = storeObject_UnitsStr(myBasis->getUnitsName()); 55 if (retHandle) { 56 err = 0; 57 } 44 58 } 45 59 } … … 48 62 /* Set C-style string output_buf to MATLAB mexFunction output*/ 49 63 plhs[0] = mxCreateDoubleScalar(retHandle); 64 plhs[1] = mxCreateDoubleScalar(err); 50 65 return; 51 66 }
Note: See TracChangeset
for help on using the changeset viewer.