1

I'm programming in Matlab and in my program I need to solve a system Ax=b, where A is a m by m square matrix with very small entries. If m increases, the entries of A become smaller.

A is a sparse matrix, so I rename this matrix with the function sparse of Matlab: B=sparse(A).

Can I use a special method to solve Bx=b without underflow or numerical errors?

Amro
  • 123,847
  • 25
  • 243
  • 454
Hiperion
  • 113
  • 3

1 Answers1

1

As noted by @Parag S. Chandakkar you can resort to vpasolve. First let us build a system with a poorly conditioned matrix

n = 10;
A = hilb(n)
b = randn(n, 1);

The usual way to solve this system is by calling

x = A\b;

while the one with vpasolve is

xs = sym('x', [n 1]);
sol = vpasolve(A*xs==b);
Jommy
  • 1,020
  • 1
  • 7
  • 14