Path: news.mathworks.com!not-for-mail
From: "Sterren Latsky" <stez17@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Solving Ax=b for large sparse matrix(1e+6 X 1e+5) and cholinc failure
Date: Thu, 8 Nov 2007 15:15:39 +0000 (UTC)
Organization: University of Bath
Lines: 68
Message-ID: <fgv96r$oov$1@fred.mathworks.com>
References: <fguq3f$ig1$1@fred.mathworks.com> <fgv6cb$2c5$1@fred.mathworks.com> <fgv898$6fk$1@fred.mathworks.com>
Reply-To: "Sterren Latsky" <stez17@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1194534939 25375 172.30.248.37 (8 Nov 2007 15:15:39 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 Nov 2007 15:15:39 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1177137
Xref: news.mathworks.com comp.soft-sys.matlab:436593



> Can I send you the matrix by a jumbo mail (your mail is that
> in your profile?)?It makes my some problem to upload the
> matrix on your website...

Honestly, it's not difficult at all. Let's say you have a
set of simultaneous equations

3a+b+7c   = 7
11a+4b+6c = 3
9a+2b     = -20

and you want to solve for a,b,c

Get this in the form Ax = b:

>>A = [3 1 7; 11 4 6; 9 2 0]

A =

     3     1     7
    11     4     6
     9     2     0

>> b = [7; 3; -20]

b =

     7
     3
   -20

>> x = A \ b

x =

   -4.9750
   12.3875
    1.3625

a = -4.9750, b = 12.3875, c = 1.3625

This can work with sparse matrices as well:

>>A = sparse(A);

A =

   (1,1)        3
   (2,1)       11
   (3,1)        9
   (1,2)        1
   (2,2)        4
   (3,2)        2
   (1,3)        7
   (2,3)        6

>> x = A \ b

x =

   -4.9750
   12.3875
    1.3625

I don't understand why you have problems.

Sterren