Ignore:
Timestamp:
Jan 11, 2006 3:55:15 PM (16 years ago)
Author:
dkearney
Message:

modified matlab bindings and tests.
includes all popular functions available in RpLibrary? and RpUnits
compile and run, but not all tests work as they should
some of these functions will be removed soon because the id field is
no longer a valid argument. path ids should be incorporated in paths from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/matlab/rpLibPutDouble.cc

    r135 r154  
    33 *  INTERFACE: Matlab Rappture Library Source
    44 *
    5  *    rpLibPutDouble(libHandle,path,value,append)
     5 *    [err] = rpLibPutDouble(libHandle,path,value,append)
    66 *
    77 * ======================================================================
     
    1616#include "RpMatlabInterface.h"
    1717
     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
    1835void mexFunction(int nlhs, mxArray *plhs[],
    1936                 int nrhs, const mxArray *prhs[])
     
    2138    int         libIndex = 0;
    2239    int         append = 0;
     40    int         err = 1;
    2341    RpLibrary*  lib = NULL;
    2442    RpLibrary*  retLib = NULL;
     
    2947    if (nrhs != 4)
    3048        mexErrMsgTxt("Two input required.");
    31     else if (nlhs > 0)
     49    else if (nlhs > 1)
    3250        mexErrMsgTxt("Too many output arguments.");
    3351
     
    3553    path = getStringInput(prhs[1]);
    3654    value = getDoubleInput(prhs[2]);
    37     append = getIntInput(prhs[4]);
     55    append = getIntInput(prhs[3]);
    3856
    3957    /* Call the C subroutine. */
     
    4260        if (lib) {
    4361            rpPutDouble(lib,path,value,append);
     62            err = 0;
    4463        }
    4564    }
    4665
     66    plhs[0] = mxCreateDoubleScalar(err);
     67
    4768    return;
    4869}
Note: See TracChangeset for help on using the changeset viewer.