Linprog error "-96@30"?

6 ビュー (過去 30 日間)
Aron Brenner
Aron Brenner 2019 年 9 月 18 日
コメント済み: Aron Brenner 2019 年 9 月 19 日
When I try to use linprog in MATLAB, it returns the error:
LINPROG has stopped because it encountered an internal error. We are sorry for the inconvenience.
Please contact technical support for assistance with your problem, quoting the code "-96@30".
I tried to run the following code:
f = [3,3.4]
A = [3,4]
b = [20000]
linprog(f,A,b,[],[],[0 0],[10000 10000])
Any help would be greatly appreciated. Thanks!

採用された回答

John D'Errico
John D'Errico 2019 年 9 月 18 日
You are trying to solve the problem of minimizing
3*x + 3.4*y
subject to the constraint
3*x + 4*y <= 20000
with bounds of [0,10000] for both x and y.
The solution seems pretty clear to me. It will happen at x=y=0. What does linprog say?
linprog(f,A,b,[],[],[0 0],[10000 10000])
Optimal solution found.
ans =
0
0
So it had no problems at all.
My guess is one of two things happened. You might be using an old MATLAB release, and possibly there was a bug. I seriously doubt that. As this is a trivial problem to solve.
An alternative is you have your own code named linprog. So do these things. First, tell us what release you are using. If you don't, then all I can say is sorry, but it worked perfectly fine using a current release.
Then, look closely at the result of:
which linprog -all
Does it show something strange? Have you written your own version of linprog? There should be only one copy of linprog. In my case, it lives here:
/Applications/MATLAB_R2019a.app/toolbox/optim/optim/linprog.m
  3 件のコメント
John D'Errico
John D'Errico 2019 年 9 月 18 日
It should do so. I have no idea why it failed, as that is a pretty simple problem to solve.
Aron Brenner
Aron Brenner 2019 年 9 月 19 日
Yep that fixed the problem. Thanks!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by