source: trunk/lang/matlab/rpAddPresets.cc @ 4503

Last change on this file since 4503 was 3177, checked in by mmc, 12 years ago

Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.

File size: 1.2 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: Matlab Rappture Library Source
4 *
5 *    result = rpAddPresets(presetName)
6 *
7 * ======================================================================
8 *  AUTHOR:  Derrick Kearney, Purdue University
9 *  Copyright (c) 2004-2012  HUBzero Foundation, LLC
10 *
11 *  See the file "license.terms" for information on usage and
12 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 * ======================================================================
14 */
15
16#include "RpMatlabInterface.h"
17
18void mexFunction(int nlhs, mxArray *plhs[],
19                 int nrhs, const mxArray *prhs[])
20{
21    std::string presetName  = "";
22    int result = -1;
23
24    /* Check for proper number of arguments. */
25    if (nrhs != 1)
26        mexErrMsgTxt("Two input required.");
27    else if (nlhs > 1)
28        mexErrMsgTxt("Too many output arguments.");
29
30    presetName = getStringInput(prhs[0]);
31
32    /* Call the C subroutine. */
33    if ( !presetName.empty() ) {
34        result = RpUnits::addPresets(presetName);
35    }
36
37    /* Set output to MATLAB mexFunction output */
38    plhs[0] = mxCreateDoubleScalar((double)result);
39
40    return;
41}
Note: See TracBrowser for help on using the repository browser.