MATLAB: Do I get Type Mismatch errors when working with matrices in MatrixVB

ldividematchmatrixMatrixVBmismmodmtimesnumberspowertypevb

I am performing simple arithmetic on matrices in MatrixVB. When I do, I receive the following Microsoft Visual Basic error:
Run-time Error '13':
Type mismatch

Best Answer

The "type mismatch" error is likely due to your using arithmetic operators (+, - , *, or / ) to perform mathematical operations.
Instead, you should use MatrixVB functions (plus, minus, times, rdivide) to operate on matrices.
For example, instead of:
Dim x As Variant
Dim a As Double
'Calculate an angle
a = 0.18
x = angle(msqrt(-1) * a)
Use:
Dim x As Variant
Dim a As Double
'Calculate an angle
a = 0.18
x = angle(times(msqrt(-1), a))
For more information on MatrixVB arithmetic functions, consult the MatrixVB documentation: "Chapter 4: Operators".