wiki:rappture_matlab_api

Rappture Matlab / Octave API

Summary:

Library Class

These functions provide an interface to the Rappture I/O library.

Constructor

[libHandle,err] = rpLib( fileName )

Functions

[retVal, err] = rpLibGetDouble( libHandle, path )
[retStr, err] = rpLibGetString( libHandle, path )

[err] = rpLibPutDouble( libHandle, path, value, append )
[err] = rpLibPutString( libHandle, path, value, append )
[err] = rpLibPutFile( libHandle, path, fileName, compress, append)

[retStr, err] = rpLibXml( lib )
[err] = rpLibResult( lib )

Units Class

These functions provide an interface to the Rappture Units library.

Functions

[retVal, result] = rpUnitsConvertDbl( fromVal, toUnitsName )
[retStr, result] = rpUnitsConvertStr( fromVal, toUnitsName, showUnits )

Utils Module

These functions provide an interface to the Rappture Utils library.

Functions

[err] = rpUtilsProgress( percent, message )


Code Synopsis & Examples:

[libHandle, err] = rpLib( path )

Purpose:

Use the xml file located at path to create a Rappture Library Object

Input Arguments:

  1. path - non-null c style string providing the path to an xml file

Return Value:

  1. libHandle - Handle for a Rappture Library object.
  2. err - Error flag

Notes:

  1. On success libHandle will be a positive integer and err will be 0.
  2. path must be a non-null c-style string
/*
  Example contents of driver.xml file
  <run>
      <input>
          <number id="temperature">
              <units>K</units>
              <default>300K</default>
              <current>300K</current>
          </number>
      </input>
  </run>
*/

infile = 'driver.xml';
[libHandle,err] = rpLib(infile);

quit;

/*
Result:
libHandle = 80502d0
*/

Last modified 17 years ago Last modified on Apr 16, 2007 8:23:45 AM