Hello,
Currently this is not available in the GUI/Menu, and the script command interface does an element-by-element (dot) multiplication than a matrix multiplication.
We will work on adding this to the menu in a future version.
For now, if you have Origin 7, you could compile the following Origin C code and then go to the script window and type:
matmult matrix1 matrix2
or type
matmult matrix1 matrix2 matrix3
The first command will create a new result (product) matrix, whereas the second one puts the result (product) in the third specified matrix.
If you want to make this part of your existing menu, contact tech support.
Easwar
OriginLab.
void matmult(string strMat1, string strMat2, string strMat3="")
{
// Declare mat1, mat2 and check validity
Matrix<double> Mat1(strMat1);
Matrix<double> Mat2(strMat2);
if(!Mat1 || !Mat2)
{
printf("Invalid matix!\n");
return;
}
// Check size compatibility
if(Mat1.GetNumCols() != Mat2.GetNumRows())
{
printf("Incompatible matrix sizes!\n");
return;
}
// If no mat3 specified, create one
if(strMat3.GetLength() == 0)
{
MatrixPage matpg;
matpg.Create("Matrix.otp");
strMat3 = matpg.GetName();
}
// Check validity
Matrix<double> Mat3(strMat3);
if(!Mat3)
{
printf("Invalid matix!\n");
return;
}
// Multiply
Mat3 = Mat1 * Mat2;
}
Edited by - easwar on 12/04/2002 11:49:22 AM