How could I get a value from a matrix with js?
I change the code example because I need get value from a matrix.
I already got "MatrixResult" from MathCAD but only columns and rows count.
how could I get value from matrix result with JS?
thx in advance!
var fileSystemObject = new ActiveXObject("Scripting.FileSystemObject");
var mathcad = new ActiveXObject("MathcadPrime.Application");
mathcad.Visible = true;
mathcad.Activate();
var worksheet = mathcad.Open(fileSystemObject.BuildPath(dirScript,"xxx.mcdx"));
worksheet.SetTitle("Title from JS Script");
outputs = worksheet.Outputs;
countOutputs = outputs.Count;
firstOutput = outputs.GetAliasByIndex(0);
var val = worksheet.OutputGetMatrixValue(firstOutput);
msg("error code " + val.ErrorCode + val.MatrixResult.Columns);
// here need to be changed!
var element = new ActiveXObject("MathcadPrime.IMathcadPrimeOutputResult");
element = val.MatrixResult.GetMatrixElement(0, 1, element);
msg("value" + element.RealResult)


