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