- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

# D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/hydro_source/get_mex_arguments.cpp File Reference

`#include "math.h"`
`#include "mex.h"`
`#include "string.h"`
`#include "Datas.h"`
`#include "get_mex_arguments.h"`

Include dependency graph for get_mex_arguments.cpp:

Go to the source code of this file.

## Defines
#define | pi 3.141592653589793
## Functions
void | initParameters (struct parameters *P)
| Initialize integrator options to default.
void | get_Parameters (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[], struct parameters *P)
| Get integrator options parameters From MATLAB.
double * | get_state (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
| Get the initial () state vector () from MATLAB.
void | delete_state (double *state)
| Free state vector () memory.
char * | get_flag (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
| Get flag from MATLAB (not used).
void | get_joystick_parameters (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[], struct joy_parameters *jP)
| Get joystick options parameters From MATLAB.
void | get_time (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[], ODE_data *f_dat)
| Get time parameter from MATLAB.

## Detailed Description

Author:
  basile.graf@epfl.ch

This file contains functions for getting parameters from MATLAB

Definition in file get_mex_arguments.cpp.

## Define Documentation

#define PI 3.141592653589793

| Definition at line 19 of file get_mex_arguments.cpp.

#define pi 3.141592653589793

| Definition at line 18 of file get_mex_arguments.cpp.

## Function Documentation

void delete_state | ( | double * | state | ) |

  | Free state vector () memory. Free the memory alocated by get_state() Parameters:
  | *state | pointer to the double[12] state array ()
Definition at line 175 of file get_mex_arguments.cpp. Referenced by mexFunction().

char* get_flag | ( | int | nlhs,
|  | mxArray * | plhs[],
|  | int | nrhs,
|  | const mxArray * | prhs[]
| ) |

  | Get flag from MATLAB (not used). Get the flag parameter from MATLAB (NOT USED) Parameters:
  | nlhs | Number of left hand side arguments in the MATLAB prompt
  | *plhs[] | Array of pointers to the left hand side arguments from MATLAB prompt
  | nrhs | Number of right hand side arguments in the MATLAB prompt
  | *prhs[] | Array of pointers to the right hand side arguments from MATLAB prompt
Definition at line 182 of file get_mex_arguments.cpp.

void get_joystick_parameters | ( | int | nlhs,
|  | mxArray * | plhs[],
|  | int | nrhs,
|  | const mxArray * | prhs[],
|  | struct joy_parameters * | jP
| ) |

| Get joystick options parameters From MATLAB. Get joystick settings from MATLAB. In the MATLAB prompt, a struct jP can be passed containing some or all of the followings (if not set, default is used): jP.dirX: Positive direction for axis X jP.dirY: Positive direction for axis Y jP.dirZ: Positive direction for axis Z jP.dirR: Positive direction for axis R jP.doX: Use joystick control or keyboard for axis X jP.doY: Use joystick control or keyboard for axis Y jP.doZ: Use joystick control or keyboard for axis Z jP.doR: Use joystick control or keyboard for axis R Definition at line 213 of file get_mex_arguments.cpp. References joy_parameters::dirR, joy_parameters::dirX, joy_parameters::dirY, joy_parameters::dirZ, joy_parameters::doR, joy_parameters::doX, joy_parameters::doY, and joy_parameters::doZ. Referenced by mexFunction().

void get_Parameters | ( | int | nlhs,
|  | mxArray * | plhs[],
|  | int | nrhs,
|  | const mxArray * | prhs[],
|  | struct parameters * | P
| ) |

  | Get integrator options parameters From MATLAB. Get solver settings from MATLAB. In the MATLAB prompt, a struct P can (must) be passed containing some or all of the followings (if not set, default is used, exept for param): P.abstol: Absolute tolerance (scalar (all the same) or vector of length 12) P.reltol: Relative tolerance (scalar) P.param : Parameters vector (diverse), MUST be given, see MATLAB model... Parameters:
  | nlhs | Number of left hand side arguments in the MATLAB prompt
  | *plhs[] | Array of pointers to the left hand side arguments from MATLAB prompt
  | nrhs | Number of right hand side arguments in the MATLAB prompt
  | *prhs[] | Array of pointers to the right hand side arguments from MATLAB prompt
  | *P | pointer to the parameters struct (in C code)
Definition at line 49 of file get_mex_arguments.cpp. References parameters::reltol. Referenced by mexFunction().

double* get_state | ( | int | nlhs,
|  | mxArray * | plhs[],
|  | int | nrhs,
|  | const mxArray * | prhs[]
| ) |

  | Get the initial () state vector () from MATLAB. Copy at from MATLAB Parameters:
  | nlhs | Number of left hand side arguments in the MATLAB prompt
  | *plhs[] | Array of pointers to the left hand side arguments from MATLAB prompt
  | nrhs | Number of right hand side arguments in the MATLAB prompt
  | *prhs[] | Array of pointers to the right hand side arguments from MATLAB prompt
Returns: pointer to the double[12] state array () Definition at line 159 of file get_mex_arguments.cpp. Referenced by mexFunction().

void get_time | ( | int | nlhs,
|  | mxArray * | plhs[],
|  | int | nrhs,
|  | const mxArray * | prhs[],
|  | ODE_data * | f_dat
| ) |

  | Get time parameter from MATLAB. Meaning: : Simulate indefinitely without returning anything to MATLAB : Simulate from to and return simulation results to MATLAB Parameters:
  | nlhs | Number of left hand side arguments in the MATLAB prompt
  | *plhs[] | Array of pointers to the left hand side arguments from MATLAB prompt
  | nrhs | Number of right hand side arguments in the MATLAB prompt
  | *prhs[] | Array of pointers to the right hand side arguments from MATLAB prompt
  | *f_dat | ODE solver data struct
Definition at line 293 of file get_mex_arguments.cpp. References ODE_data::time_param. Referenced by mexFunction().

void initParameters | ( | struct parameters * | P | ) |

  | Initialize integrator options to default. Initializes P.reltol and P.abstol to default values. The P.param array is set to zeros (not a valid default for meaningfull simulation, just to avoid any crash!!!) Parameters:
  | *P | pointer to the parameters struct
Definition at line 23 of file get_mex_arguments.cpp. References parameters::abstol, parameters::param, PARAMNUM, parameters::reltol, and STATENUM. Referenced by mexFunction().