GetMatrix
Transfer Matlab matrix to Origin Matrix. OriginC matrix not currently supported.
BOOL GetMatrix( LPCSTR lpcszMatrixName, Matrix * pmmReal, Matrix * pmmImag = NULL, LPCSTR lpcszMatLabWorkspace = NULL )
Returns TRUE on successful exit and FALSE on error.
EX1
// Assumes Current window is Matrix in Origin #include <ExternApps.h> void Matlab_GetMatrix_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 MatrixLayer matLayer=Project.ActiveLayer(); if (matLayer.IsValid()) { Matrix mReal(matLayer); BOOL bRet = matObj.GetMatrix("ma", &mReal); //Transfer mat Matlab's matrix to mReal. } }
Matlab::PutMatrix
ExternApps.h