Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: integer solutions for x_1+x_2+...+x_n = k
Date: Sun, 2 Nov 2008 19:51:02 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 11
Message-ID: <gel0b6$3li$1@fred.mathworks.com>
References: <geku21$eku$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1225655462 3762 172.30.248.35 (2 Nov 2008 19:51:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 2 Nov 2008 19:51:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:498538


"Oriole " <oriole_ni@hotmail.com> wrote in message <geku21$eku$1@fred.mathworks.com>...

> 
> It works well when n is small, like n= 20, but when  n is bigger, it does not work out at all, Matlab is busy for many many hours without giving any result...
>

Have you check the number of solutions for large n? It might be not possible to compute.

Here is code in FEX  that can accomplish that, but again, try to look at the feasibility before solving: http://www.mathworks.com/matlabcentral/fileexchange/17818

Bruno