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$>
References: <g5sgla$b7r$> <g5sjfa$fbg$> <g5td8a$s9q$> <g5tep3$g7r$> <g5thqi$h7d$> <g5tj02$rj4$> <g5tleq$siu$> <g5ujb2$7c1$> <g5v5rm$iav$> <g60239$srl$> <g62uv6$r2k$> <g68au9$b8u$> <g6iaid$rrr$> <g6ic71$jqt$> <g6l6lu$40r$> <g6l7nl$hpr$> <g6lh5j$laa$> <g6qj0s$mut$> <g6qm7f$5mc$> <g6sgu6$f5s$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1217525576 24722 (31 Jul 2008 17:32:56 GMT)
NNTP-Posting-Date: Thu, 31 Jul 2008 17:32:56 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:482950

"Leon galushko" <> wrote in
message <g6sgu6$f5s$>...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in
> message <g6qm7f$5mc$>...

> 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.