Hi Andrew,
If you want to do this from LabTalk, you can use code like below, where active window is assumed to be the worksheet to begin with:
mat.wksname$ = %H;
win -T M;
mat.matname$ = %H;
mat.w2m();
If you want to do this from Origin C, you can use code like below, where you will call this function passing the name of the worksheet to be converted.
void wks2mat(string strWksName)
{
Worksheet wks(strWksName); // Declare Worksheet
MatrixPage matPg; // Declare Matrix Page
matPg.Create("Matrix.OTP"); // Create Matrix Page using standard template
string strMatName = matPg.GetName(); // Get name of Matrix Page that was created
using mat = LabTalk.Mat; // Set up access to LabTalk mat object from Origin C
mat.wksname$ = strWksName; // Set name of worksheet in mat object
mat.matname$ = strMatName; // Set name of result matrix in mat object
mat.w2m(); // Use wkstomat conversion method of mat object
}
Easwar
OriginLab.