So I was trying to use *A ^{T}B* to calculate the scalar product of a vector with itself:

## Definition of a *4x1* vector *E*

Set *USER* mode to enter the coordinates of the vector *E = [1 2 3 4] ^{T}*:

4

ENTER

1

DIM E

MATRIX 1

1 STO E

2 STO E

3 STO E

4 STO E

## Calculate *E*^{T}E

^{T}E

We'd expect that to be:

*1*.

^{2}+ 2^{2}+ 3^{2}+ 4^{2}= 30

RCL MATRIX E

RESULT A

ENTER

MATRIX 5

MATRIX 1

RCL A

And we get indeed:

*30.0000*

## Running as a program

Use *CLEAR PRGM* to have all the programs removed. **WARNING:** you may not want to do that!

Now enter the few steps from above:

001-42,26,11 RESULT A

002- 36 ENTER

003-42,16, 5 MATRIX 5

004-42,16, 1 MATRIX 1

005-^{u}45 11 RCL A

And run the program:

RCL MATRIX E

RTN

R/S

I get an **ERROR 11: Improper Matrix Argument**. For *MATRIX 5* the *Appendix A: Error Conditions* states as possible reasons:

- the input is a scalar;

- the dimensions are incompatible; or

- the result is one of the arguments.

The funny thing is that the result is there. The stack consists of the following values:

T:

Z: A 1 1

Y: 30.0000

X: 30.0000

But the program stopped at this line:

003-42,16, 5 MATRIX 5

## Workaround

A simple workaround is to add a *RTN* statement at the end of the program. Or you can single-step through the program as well.

Now is this a well known bug of the HP-15C? Could somebody verify this on a *real* calculator and possibly on the HP-15C LE? Unfortunately I can only test this with an emulator.

Kind regards

Thomas

PS: You think I should use *MATRIX 8* followed by *x ^{2}* instead?

*Edited: 3 Feb 2012, 11:44 a.m. *