Changeset 154 for trunk/src/matlab/rpLibPutDouble.cc
- Timestamp:
- Jan 11, 2006 3:55:15 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpLibPutDouble.cc
r135 r154 3 3 * INTERFACE: Matlab Rappture Library Source 4 4 * 5 * rpLibPutDouble(libHandle,path,value,append)5 * [err] = rpLibPutDouble(libHandle,path,value,append) 6 6 * 7 7 * ====================================================================== … … 16 16 #include "RpMatlabInterface.h" 17 17 18 /**********************************************************************/ 19 // METHOD: [err] = rpLibPutDouble (libHandle,path,value,append) 20 /// Set the value of a node. 21 /** 22 * Clients use this to set the value of a node. If the path 23 * is not specified, it sets the value for the root node. 24 * Otherwise, it sets the value for the element specified 25 * by the path. The value is treated as the text within the` 26 * tag at the tail of the path. 27 * 28 * If the append flag is set to 1, then the` 29 * value is appended to the current value. Otherwise, the` 30 * value specified in the function call replaces the current value. 31 * 32 */ 33 34 18 35 void mexFunction(int nlhs, mxArray *plhs[], 19 36 int nrhs, const mxArray *prhs[]) … … 21 38 int libIndex = 0; 22 39 int append = 0; 40 int err = 1; 23 41 RpLibrary* lib = NULL; 24 42 RpLibrary* retLib = NULL; … … 29 47 if (nrhs != 4) 30 48 mexErrMsgTxt("Two input required."); 31 else if (nlhs > 0)49 else if (nlhs > 1) 32 50 mexErrMsgTxt("Too many output arguments."); 33 51 … … 35 53 path = getStringInput(prhs[1]); 36 54 value = getDoubleInput(prhs[2]); 37 append = getIntInput(prhs[ 4]);55 append = getIntInput(prhs[3]); 38 56 39 57 /* Call the C subroutine. */ … … 42 60 if (lib) { 43 61 rpPutDouble(lib,path,value,append); 62 err = 0; 44 63 } 45 64 } 46 65 66 plhs[0] = mxCreateDoubleScalar(err); 67 47 68 return; 48 69 }
Note: See TracChangeset
for help on using the changeset viewer.