Last change
on this file since 5900 was
5675,
checked in by ldelgass, 9 years ago
|
merge r5673 from trunk (eol-style)
|
-
Property svn:eol-style set to
native
|
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 | |
---|
18 | void 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.