Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linear equation with restrictions
Date: Thu, 31 Jul 2008 17:32:56 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 25
Message-ID: <g6st08$o4i$1@fred.mathworks.com>
References: <g5sgla$b7r$1@fred.mathworks.com> <g5sjfa$fbg$1@fred.mathworks.com> <g5td8a$s9q$1@fred.mathworks.com> <g5tep3$g7r$1@fred.mathworks.com> <g5thqi$h7d$1@fred.mathworks.com> <g5tj02$rj4$1@fred.mathworks.com> <g5tleq$siu$1@fred.mathworks.com> <g5ujb2$7c1$1@fred.mathworks.com> <g5v5rm$iav$1@fred.mathworks.com> <g60239$srl$1@fred.mathworks.com> <g62uv6$r2k$1@fred.mathworks.com> <g68au9$b8u$1@fred.mathworks.com> <g6iaid$rrr$1@fred.mathworks.com> <g6ic71$jqt$1@fred.mathworks.com> <g6l6lu$40r$1@fred.mathworks.com> <g6l7nl$hpr$1@fred.mathworks.com> <g6lh5j$laa$1@fred.mathworks.com> <g6qj0s$mut$1@fred.mathworks.com> <g6qm7f$5mc$1@fred.mathworks.com> <g6sgu6$f5s$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 1217525576 24722 172.30.248.35 (31 Jul 2008 17:32:56 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 31 Jul 2008 17:32:56 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:482950


"Leon galushko" <leonid.galushko@rwth-aachen.de> wrote in
message <g6sgu6$f5s$1@fred.mathworks.com>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in
> message <g6qm7f$5mc$1@fred.mathworks.com>...

> 
> Sorry, ich meant c>0 not a.
> 

I see. To ways to do it.

1. Brute force: find all solutions with c>=0, then filter
out by find.

2. Neater way: c>0 means cm1:=c-1 >=0.

So solving
(A) a*c = b such that c > 0

is equivalent to solving

(B) a*cm1 = b-sum(a) such that cm1>=0,
Then take c=cm1+1.

Bruno