[97] | 1 | /* |
---|
| 2 | * ---------------------------------------------------------------------- |
---|
| 3 | * INTERFACE: Matlab Rappture Library Source |
---|
| 4 | * |
---|
[135] | 5 | * rpLibPutDouble(libHandle,path,value,append) |
---|
[97] | 6 | * |
---|
| 7 | * ====================================================================== |
---|
| 8 | * AUTHOR: Derrick Kearney, Purdue University |
---|
[115] | 9 | * Copyright (c) 2004-2005 Purdue Research Foundation |
---|
| 10 | * |
---|
| 11 | * See the file "license.terms" for information on usage and |
---|
| 12 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
[97] | 13 | * ====================================================================== |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #include "RpMatlabInterface.h" |
---|
| 17 | |
---|
| 18 | void mexFunction(int nlhs, mxArray *plhs[], |
---|
| 19 | int nrhs, const mxArray *prhs[]) |
---|
| 20 | { |
---|
| 21 | int libIndex = 0; |
---|
| 22 | int append = 0; |
---|
| 23 | RpLibrary* lib = NULL; |
---|
| 24 | RpLibrary* retLib = NULL; |
---|
| 25 | char* path = NULL; |
---|
| 26 | double value = 0.0; |
---|
| 27 | |
---|
| 28 | /* Check for proper number of arguments. */ |
---|
| 29 | if (nrhs != 4) |
---|
| 30 | mexErrMsgTxt("Two input required."); |
---|
| 31 | else if (nlhs > 0) |
---|
| 32 | mexErrMsgTxt("Too many output arguments."); |
---|
| 33 | |
---|
| 34 | libIndex = getIntInput(prhs[0]); |
---|
| 35 | path = getStringInput(prhs[1]); |
---|
| 36 | value = getDoubleInput(prhs[2]); |
---|
| 37 | append = getIntInput(prhs[4]); |
---|
| 38 | |
---|
| 39 | /* Call the C subroutine. */ |
---|
| 40 | if ( (libIndex > 0) && path ) { |
---|
| 41 | lib = getObject_Lib(libIndex); |
---|
| 42 | if (lib) { |
---|
| 43 | rpPutDouble(lib,path,value,append); |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | return; |
---|
| 48 | } |
---|