Ignore:
Timestamp:
Jan 11, 2006 3:55:15 PM (18 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/rpUnitsGetBasis.cc

    r141 r154  
    33 *  INTERFACE: Matlab Rappture Library Source
    44 *
    5  *    [unitsHandle] = rpUnitsGetBasis(unitsHandle)
     5 *    [unitsHandle,err] = rpUnitsGetBasis(unitsHandle)
    66 *
    77 * ======================================================================
     
    1616#include "RpMatlabInterface.h"
    1717
     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
    1828void mexFunction(int nlhs, mxArray *plhs[],
    1929                 int nrhs, const mxArray *prhs[])
     
    2434    int retHandle = 0;
    2535    int unitsHandle = 0;
     36    int err = 1;
    2637
    2738    /* Check for proper number of arguments. */
    2839    if (nrhs != 1)
    2940        mexErrMsgTxt("Two input required.");
    30     else if (nlhs > 1)
     41    else if (nlhs > 2)
    3142        mexErrMsgTxt("Too many output arguments.");
    3243
    33     unitsHandle = getIntInput(prhs[1]);
     44    unitsHandle = getIntInput(prhs[0]);
    3445
    3546    /* Call the C subroutine. */
     
    4253            if (myBasis) {
    4354                retHandle = storeObject_UnitsStr(myBasis->getUnitsName());
     55                if (retHandle) {
     56                    err = 0;
     57                }
    4458            }
    4559        }
     
    4862    /* Set C-style string output_buf to MATLAB mexFunction output*/
    4963    plhs[0] = mxCreateDoubleScalar(retHandle);
     64    plhs[1] = mxCreateDoubleScalar(err);
    5065    return;
    5166}
Note: See TracChangeset for help on using the changeset viewer.