Matrix–Vector Multiplication Calculator

Compute matrix–vector products instantly with clear, guided steps shown. Resize inputs, paste data, or generate random test sets. Validate compatibility automatically and highlight dimensional mismatches for safety. Save tables as CSV or PDF effortlessly anywhere. Perfect for learners, engineers, and teachers building intuition today.

A×x
Inputs
Matrix A (m×n)
Tip: Use Tab/Shift+Tab to move quickly across cells.
Vector x (n×1)

Result y = A×x
Example Data
Preset Matrix A Vector x Action
3×3 Demo [[2, -1, 0], [3, 4, 1], [0, 5, 2]] [1, 2, 3]
2×4 Dense [[1.2, 0, -3.5, 2], [4, 5.5, 0.75, -1]] [0.5, 2, -1, 3]
Click “Load” to populate the grids; adjust values if needed.
Formula Used

Matrix–vector multiplication forms a new vector \( \mathbf{y} \in \mathbb{R}^{m} \) from a matrix \( \mathbf{A} \in \mathbb{R}^{m\times n} \) and a vector \( \mathbf{x} \in \mathbb{R}^{n} \):

\( \mathbf{y} = \mathbf{A}\mathbf{x} \)

The i-th entry is the dot product of row i of \( \mathbf{A} \) and \( \mathbf{x} \):

\( y_i = \sum_{j=1}^{n} a_{ij}\,x_j \quad \text{for } i=1,\dots,m \)

Time complexity is \(O(mn)\). Values are computed in double precision and displayed with the selected rounding.

How to Use
  1. Set the number of rows \(m\) and columns \(n\). Vector length is \(n\).
  2. Enter values directly in the grids, or paste from the text areas.
  3. Click Calculate to compute \( \mathbf{y} = \mathbf{A}\mathbf{x} \).
  4. Toggle Show steps to see each row’s dot product expansion.
  5. Export results via CSV or PDF, or copy steps for reports.
  6. Use Shareable URL to preserve inputs for later or teammates.
  • Empty cells are treated as zero. Use precision control for rounding only the display.
  • Local storage remembers your latest session on this device.
Applications & Use Cases
  • Linear systems step: Given \( \mathbf{A} \) and an iterate \( \mathbf{x} \), compute \( \mathbf{A}\mathbf{x} \) inside iterative solvers (CG, GMRES).
  • Computer graphics: Apply linear transforms to coordinates, where \( \mathbf{x} \) contains point components.
  • Dynamics & control: State update \( \mathbf{x}_{k+1} = \mathbf{A}\mathbf{x}_k + \mathbf{b} \).
  • Markov chains: Next-state probabilities from transition matrix times distribution vector.
  • Neural networks: Dense layer output \( \mathbf{y} = \mathbf{W}\mathbf{x} + \mathbf{b} \).
  • Data pipelines: Feature mixing, filters, and dimensionality reduction steps.

Use this tool to prototype the multiply step before coding full pipelines.

Performance & Numerical Considerations
  • Complexity: \(O(mn)\) multiplies and adds; cost grows with size.
  • Sparsity: Exploit zero entries by storing nonzeros only; compute faster and use less memory.
  • Conditioning: Sensitivity obeys \( \frac{\lVert \Delta \mathbf{y}\rVert}{\lVert \mathbf{y}\rVert} \lesssim \kappa(\mathbf{A}) \frac{\lVert \Delta \mathbf{x}\rVert}{\lVert \mathbf{x}\rVert} \), where \( \kappa(\mathbf{A}) \) is the condition number.
  • Scaling: Normalize inputs to mitigate overflow/underflow; prefer comparable magnitudes.
  • Accumulation order: Summation order affects rounding error; Kahan summation reduces drift.
  • Cache locality: Row-major access improves throughput for \( \mathbf{A}\mathbf{x} \) on typical CPUs.

Displayed precision affects formatting only; raw computations keep full double precision internally.

FAQs
1) What sizes are compatible for multiplication?

Matrix \( \mathbf{A} \) must be \( m\times n \) and vector \( \mathbf{x} \) must be length \( n \). The result \( \mathbf{y} \) has length \( m \).

2) Does the calculator support decimals and negatives?

Yes. You can use integers, decimals, and negative values. Display rounding is configurable from 0 to 8 decimal places.

3) Why do I see a dimension mismatch alert?

If your vector length does not equal the number of matrix columns, multiplication is undefined. Adjust either \( n \) or the vector length.

4) Is right-multiplication \( \mathbf{x}^\top \mathbf{A} \) supported?

This tool evaluates \( \mathbf{A}\mathbf{x} \). Right-multiplication produces a row vector and requires different dimensions and layout.

5) How are the steps derived?

Each step shows a dot product expansion of a row of \( \mathbf{A} \) with \( \mathbf{x} \), listing term-by-term multiplications and their sum.

6) Will exporting change my numbers?

No. CSV exports the raw computed values. PDF captures the rendered view with your chosen precision and formatting.

Related Calculators

Row Reduction RREF CalculatorDiagonalization Checker CalculatorLU Decomposition Steps CalculatorQR Decomposition Steps Calculatormatrix calculator with variablesGauss-Jordan inverse calculatorPolynomial linear independence calculatorLinear independence of matrix calculatorComplex matrix inverse calculatorQR decomposition least squares

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.