MLArray objArrayRetrived = mfr.getMLArray(currentVariable);
if (objArrayRetrived instanceof MLDouble) {
// public MLArray getMLArray(String name)
// Returns the value to which the read file maps the specified array name. Returns null if the file contains no content for this name.
// Returns: - the MLArray to which this file maps the specified name, or null if the file contains no content for this name.
MLDouble mlArrayRetrived = (MLDouble)mfr.getMLArray(currentVariable);
String arrayName = mlArrayRetrived.getName();
int nrows = mlArrayRetrived.getM();
int ncols = mlArrayRetrived.getN();
double [][] data = mlArrayRetrived.getArray(); // get data
scalaExec.Interpreter.GlobalValues.data = new double[nrows][ncols]; // copy of data array
for (int r=0; r < nrows; r++)
for (int c=0; c< ncols; c++)
scalaExec.Interpreter.GlobalValues.data[r][c] = data[r][c];
// keep a global reference in order to be accessible from the interpreter