ttanalogin.cpp

来自「用于网络控制系统仿真」· C++ 代码 · 共 43 行

CPP
43
字号
/* * TrueTime, Version 1.5 * Copyright (c) 2007 * Martin Ohlin, Dan Henriksson and Anton Cervin * Department of Automatic Control LTH * Lund University, Sweden */#define KERNEL_MATLAB#include "../ttkernel.h"RTsys* rtsys;#include "../analogin.cpp"#include "getrtsys.cpp"void mexFunction( int nlhs, mxArray *plhs[],                  int nrhs, const mxArray *prhs[] ){  rtsys = getrtsys(); // Get pointer to rtsys   if (rtsys==NULL) {    return;  }  // Check number and type of arguments.   if (nrhs != 1) {    MEX_ERROR("Wrong number of input arguments!\nUsage: ttAnalogIn(inpChan)");    return;  }  if (!mxIsDoubleScalar(prhs[0])) {    MEX_ERROR("ttAnalogIn: inpChan must be a number");    return;  }  int inpChan = (int) *mxGetPr(prhs[0]);  double retval = ttAnalogIn(inpChan);   plhs[0] = mxCreateScalarDouble(retval);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?