Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
solve Ax=b

Subject: solve Ax=b

From: Wendy

Date: 18 Feb, 2010 14:28:06

Message: 1 of 3

Hi,

I have a (3355x2) matrix (called A) and a (3355x1) vector (called 'b'), and I am solving for x as Ax=b.

I used x=A\b. However, when I multiply A*x, the solution is very different from 'b'. Does anybody know how to solve the problem? Can I use this the optimization toolbox to solve the system of linear equations?

Thank you in advance,
Wendy

Subject: solve Ax=b

From: Matt J

Date: 18 Feb, 2010 14:49:06

Message: 2 of 3

"Wendy " <wlq121@gmail.com> wrote in message <hljipm$isj$1@fred.mathworks.com>...
> Hi,
>
> I have a (3355x2) matrix (called A) and a (3355x1) vector (called 'b'), and I am solving for x as Ax=b.
>
> I used x=A\b. However, when I multiply A*x, the solution is very different from 'b'. Does anybody know how to solve the problem? Can I use this the optimization toolbox to solve the system of linear equations?
================

You did solve the problem. A\b is the least squares solution to A*x=b, so whatever x=A\b returned is the best agreement between A*x and b that was available in a least squares sense.

Subject: solve Ax=b

From: James Allison

Date: 18 Feb, 2010 15:11:00

Message: 3 of 3

What is the condition of A (i.e., cond(A))? If A is poorly conditioned,
the results may be inaccurate. You could try scaling or diagonalization
of A to get more accurate results.

-James

Wendy wrote:
> Hi,
>
> I have a (3355x2) matrix (called A) and a (3355x1) vector (called 'b'),
> and I am solving for x as Ax=b.
> I used x=A\b. However, when I multiply A*x, the solution is very
> different from 'b'. Does anybody know how to solve the problem? Can I
> use this the optimization toolbox to solve the system of linear equations?
>
> Thank you in advance,
> Wendy

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us