Ad Space — Top Banner

Invalid Dimension

HP HP Calculator

Severity: Minor

What Does This Error Mean?

Invalid Dimension means a matrix or list operation has incompatible sizes. For example, trying to multiply matrices with mismatched dimensions or add lists of different lengths. Check the dimensions of all matrices and lists involved.

Affected Models

  • HP 50g
  • HP Prime
  • HP 48GX
  • HP 48G

Common Causes

  • Matrix multiplication with incompatible dimensions (A cols != B rows)
  • Adding or subtracting matrices of different sizes
  • Lists of different lengths in a statistical operation
  • Attempting to invert a non-square matrix
  • Dot product of vectors with different lengths

How to Fix It

  1. Check matrix dimensions before operating.

    To multiply A x B, the number of columns in A must equal the number of rows in B. A 3x2 matrix can multiply a 2x4 matrix (result is 3x4). A 3x2 matrix cannot multiply a 3x4 matrix.

  2. For addition/subtraction: matrices must be the same size.

    You can only add a 3x3 matrix to another 3x3 matrix. Adding a 3x3 to a 2x2 gives Invalid Dimension.

  3. For statistics: make sure all lists have equal length.

    If your X data has 10 points but Y data has 8, the regression will fail. Edit the lists to ensure they match.

Frequently Asked Questions

How do I check a matrix's dimensions on the HP 50g?

Press the matrix on the stack, then use SIZE to see its dimensions. Or enter the Matrix Editor to see the rows and columns visually.

Can I multiply a row vector by a column vector?

Yes, if the dimensions match. A 1x3 row vector times a 3x1 column vector gives a 1x1 result (the dot product). A 3x1 column vector times a 1x3 row vector gives a 3x3 matrix (the outer product).