PutMatrix
Transfer Origin Matrix to Matlab matrix. OriginC matrix not currently supported. Complex matrices not currently supported
BOOL PutMatrix( LPCSTR lpcszMatrixName, Matrix * pmmReal, Matrix * pmmImag = NULL, LPCSTR lpcszMatLabWorkspace = NULL )
Returns TRUE on successful exit and FALSE on error.
EX1
#include <ExternApps.h> // Current window is matrix and with sample data exists in Origin void Matlab_PutMatrix_ex1() { Matlab matObj(TRUE); if(!matObj) { out_str("No Matlab found"); return; } // Matlab object successfully created, i.e. communication established MatrixLayer matLayer=Project.ActiveLayer(); if (matLayer.IsValid()) { Matrix mReal(matLayer); BOOL bRet = matObj.PutMatrix("mat", &mReal); //Transfer mReal data to mat Matlab's matrix. mat will be created if it didn't exist before if (bRet) { string strRet = matObj.Execute("mat"); //strRet will contain display of mat out_str(strRet); } } }
Matlab::GetMatrix
ExternApps.h