Matlab
Matlab class provides communication between Origin and Matlab.
EX1
#include <origin.h> #include <externApps.h> // this file is not included in origin.h //////////////////////////////////////////////////////////////////////////////////// void mltest() { Matlab matObj(true); if(!matObj) { out_str("No Matlab found"); return; } //defines 3x5 matrix named ma string strRet = matObj.Execute("ma=[1 2 3 4 5; 4 5 6 7 8;10.3 4.5 -4.7 -23.2 -6.7]"); out_str(strRet);// show str from Matlab // put matrix into Origin matrix MatrixLayer matLayer; matLayer.Create(); Matrix mao(matLayer); //Transfer Matlab's matrix (ma) to Origin's mao matrix. BOOL bRet = matObj.GetMatrix("ma", &mao); }
ExternApps.h