Execute
Executes command in Matlab workspace
string Execute( LPCSTR lpcszCommand )
BOOL Execute( LPCSTR lpcszCommand, string & strReturn )
Returns the string containing Matlab command window output.
//Comment: ";" at the end of the command suppresses output in Matlab.
Returns TRUE on successful exit and FALSE on error.
EX1
#include <ExternApps.h> void Matlab_Execute_ex1() { Matlab matObj(true); if(!matObj) { out_str("No Matlab found !!!!!"); return; } string strRet1 = matObj.Execute("ma=[1 2 3; 4 5 6]"); //defines 2x3 matrix named ma out_str(strRet1); }
ExternApps.h