Path: news.mathworks.com!not-for-mail
From: "Leon galushko" <leonid.galushko@rwth-aachen.de>
Newsgroups: comp.soft-sys.matlab
Subject: Re: linear equation with restrictions
Date: Mon, 28 Jul 2008 19:29:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 50
Message-ID: <g6l6lu$40r$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>
Reply-To: "Leon galushko" <leonid.galushko@rwth-aachen.de>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1217273342 4123 172.30.248.38 (28 Jul 2008 19:29:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 28 Jul 2008 19:29:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1183838
Xref: news.mathworks.com comp.soft-sys.matlab:482286


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in
message <g6ic71$jqt$1@fred.mathworks.com>...
> Test program:
> 
> a=[770 105 60 85 50];
> b = 9435;
> 
> %
> % solving
> % c1*a1 + ... cn*an = b
> % c >=0
> 
> c = intlin(a, b);
> 
> if isnan(c) % unbounded, infinity solutions
> elseif ~isempty(c)
> 
>     fprintf('\nSolutions c:\n\n');
>     disp(c);
>     fprintf('\nNumber of solutions = %d\n\n', size(c,1));
>    
>     bverif = c*a';
>     bverifu = unique(bverif);
>     
>     if length(bverifu)~=1 || bverifu~=b
>         fprintf('Wrong solution(s)\n');
>         disp(c(bverif~=b,:));
>         save test_inlin_debug.mat a cc b
>     end
>     
> else % mode(b,g)==0
>     fprintf('There is no solution\n');
> end
> 
Hi Bruno,
Thank you for that!
I'am just trying to test it, now it comes to the following
error message: 
??? Error using ==> linprog at 175
The number of rows in A must be the same as the length of b.

In your sourcecode I found a comment:

'% Beware, his is Bruno's linprog, not MATLAB one in
optimization
    % tool box, the result may be different.
    sol = linprog([], [], a', b, cost, L, U);'

Wouldn't run it with some Stadard- MatLab of mine?
Leon