Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

MatlabEngine Class Reference

programming interface for calling Matlab from Diffpack. More...

#include <MatlabEngine.h>

Inheritance diagram for MatlabEngine::

MatlabGraphics List of all members.

Public Types

enum  { ROW = 1, COL = 2 }

Public Methods

 MatlabEngine ()
 ~MatlabEngine ()
void putMatrix (const Mat(real) &A, const String &s)
Mat(real) getMatrix (const String &s)
void putVector (const Vec(real) &v, const String &s, int dim=COL)
void putVector (const Vec(real) &v, int size, const String &s, int dim=COL)
Vec(real) getVector (const String &s)
void putArrayGen (const ArrayGen(real) &A, const String &s)
ArrayGen(real) getArrayGen (const String &s)
void putScalar (real x, const String &s)
real getScalar (const String &s)
void operator() (const String &s)
int stat () const
void wait ()

Protected Methods

void _errorMessage ()

Protected Attributes

Engine* fep
int fStat
String fErrorBuffer

Detailed Description

programming interface for calling Matlab from Diffpack.

NAME: MatlabEngine - programming interface for calling Matlab from Diffpack

DESCRIPTION:

This class encapsulates the routines provided by the MATLAB Computational Services (see MATLAB External Interface Guide) and allows the user to make MATLAB calls from their C++ programs.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
ROW  
COL  


Constructor & Destructor Documentation

MatlabEngine::MatlabEngine ( ) [inline]
 

Creates an instance of the MatlabEngine. This starts up the engine, or returns with an error if the engine cannot be started.

MatlabEngine::~MatlabEngine ( ) [inline]
 


Member Function Documentation

void MatlabEngine::_errorMessage ( ) [inline, protected]
 

ArrayGen(real) MatlabEngine::getArrayGen ( const String & s ) [inline]
 

this function allows the user to retrieve an n-dimensional array with the given name from the MATLAB workspace.

Mat(real) MatlabEngine::getMatrix ( const String & s ) [inline]
 

this function allows the user to retrieve a matrix with the given name from the MATLAB workspace.

real MatlabEngine::getScalar ( const String & s ) [inline]
 

this function allows the user to retrieve a scalar with the given name from the MATLAB workspace.

Vec(real) MatlabEngine::getVector ( const String & s ) [inline]
 

this function allows the user to retrieve a vector with the given name from the MATLAB workspace.

void MatlabEngine::operator() ( const String & s ) [inline]
 

void MatlabEngine::putArrayGen ( const ArrayGen(real) & A,
const String & s ) [inline]
 

this routine allows the user to put a Diffpack n-dimensional array into the MATLAB workspace. The string variable name will be used to identify the variable in the workspace and can be used in subsequent MATLAB calls.

void MatlabEngine::putMatrix ( const Mat(real) & A,
const String & s ) [inline]
 

this routine allows the user to put a Diffpack matrix into the MATLAB workspace. The string variable name will be used to identify the variable in the workspace and can be used in subsequent MATLAB calls.

void MatlabEngine::putScalar ( real x,
const String & s ) [inline]
 

this routine allows the user to put a Diffpack scalar into the MATLAB workspace. The string variable name will be used to identify the variable in the workspace and can be used in subsequent MATLAB calls.

void MatlabEngine::putVector ( const Vec(real) & v,
int size,
const String & s,
int dim = COL ) [inline]
 

See documentation of one of the overloaded functions.

void MatlabEngine::putVector ( const Vec(real) & v,
const String & s,
int dim = COL ) [inline]
 

this routine allows the user to put a Diffpack vector into the MATLAB workspace. The string variable name will be used to identify the variable in the workspace and can be used in subsequent MATLAB calls.

int MatlabEngine::stat ( ) const [inline]
 

returns the status of the MATLAB Engine. If MATLAB cannot issue a given command, "stat()" will return a non-zero value. If everything went okay, it will return a 0 value. Note that syntax errors sent to the MATLAB engine will be caught by the member function "operator (const String& s)".

void MatlabEngine::wait ( ) [inline]
 

waits for entry from the keyboard before continuing. Since the destructor for MATLAB kills any graphics windows, the user may wish to insert a wait in their program so they have time to view graphics output.


Member Data Documentation

String MatlabEngine::fErrorBuffer [protected]
 

int MatlabEngine::fStat [protected]
 

Engine * MatlabEngine::fep [protected]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.