fboehlandt
Active Member
- Joined
- Sep 9, 2008
- Messages
- 334
Hi everyone,
I need to perform a number of matrix calculations in VBA and intend to use Excel Worksheetfunctions for that. Unfortunately, matrix subtract is only know to .net and excel only knows the following matrix formulas:
.MMULT()
.MINVERSE()
.TRANSPOSE()
.DETERM()
I would like to subtract one matrix from another. My not very elegant workaround is the following:
ReDim subtract(1 To n, 1 To n)
For j = 1 To n
For i = 1 To n
subtract(j, i) = matrix1(j, i) - matrix2(j, i)
Next i
Next j
Both matrices are identical in size (req.) and symmetrical (if it matters). Is there a way of entering a non-descript array formula to calculate the difference of the two matrices?
I need to perform a number of matrix calculations in VBA and intend to use Excel Worksheetfunctions for that. Unfortunately, matrix subtract is only know to .net and excel only knows the following matrix formulas:
.MMULT()
.MINVERSE()
.TRANSPOSE()
.DETERM()
I would like to subtract one matrix from another. My not very elegant workaround is the following:
ReDim subtract(1 To n, 1 To n)
For j = 1 To n
For i = 1 To n
subtract(j, i) = matrix1(j, i) - matrix2(j, i)
Next i
Next j
Both matrices are identical in size (req.) and symmetrical (if it matters). Is there a way of entering a non-descript array formula to calculate the difference of the two matrices?