2.2.2.1.5 Matlab::GetString

Description

Transfer Matlab character array to Origin string.

Syntax

string GetString( LPCSTR lpcszStringName, LPCSTR lpcszMatLabWorkspace = NULL )

Parameters

lpcszStringName
[input] The name of the Matlab character array source
lpcszMatLabWorkspace
[input] default value "base" defines lpcszMatrixName in default Matlab workspace. The use of "global" for global Matlab workspace is not currently supported

Return

Returns Matlab's character array as a string.

Examples

EX1

#include <externApps.h> // this file is not included in origin.h
void Matlab_GetString_ex1()
{
    Matlab matObj(TRUE);
    if(!matObj)
    {
        out_str("No Matlab found");
        return;
    }
// Matlab object successfully created, i.e. communication established
   if (matObj.PutString( "mcharname", "OC::Matlab Origin Text", "base" ))
   {
	string strMcharname;
	strMcharname = matObj.GetString( "mcharname", "base" );
	out_str(strMcharname);
   }
}

Remark

See Also

Matlab::PutString

Header to Include

ExternApps.h