Hi Elena:
The following script is a simple example to put data from one column into a n by m matrix.
// Supposed source data in column 1 of sheet1, book1
// and target matrix is the first matrix in mbook1, msheet1
range rw = [book1]sheet1!col(1);
range rm = [mbook1]msheet1!mat(1);
n = 3; // matrix row
m = 2; // matrix column
for(int ii = 1; ii <= n; ii++)
{
for(int jj = 1; jj <= m; jj++)
{
rm[ii, jj] = rw[(ii-1)*m + jj];
}
}
Please change the script as you need. In the script, we use ranges to access different Origin objects. Maybe you can start reading from the range notation charpter in our LabTalk Guide to know how to write such scripts?
Thanks
Larry