Write a function that will take in a simplex tableau and an associated basis, and return the initial feasible
Show older comments
Please help me with this question.. I have attached the.m file of my code.
Also, here is the sample tableau and basis
tableau = [0 -2 0 0 0;
1 -1 1 0 4;
-1 1 0 1 1]
basis = [3; 4]
9 Comments
the cyclist
on 30 Apr 2015
Edited: the cyclist
on 30 Apr 2015
I don't see an attached file. You might want to edit your question and try to attach it again.
LG
on 30 Apr 2015
Edited: the cyclist
on 30 Apr 2015
John D'Errico
on 30 Apr 2015
Actually, tableau is the phrase usually used for linear programming. At least it was for me, and my command of French is limited to what I learned (poorly at that) in the 6th grade.
LG
on 30 Apr 2015
LG
on 30 Apr 2015
Søren Jensen
on 30 Apr 2015
numel means number of elements, so you are trying to access basis(3) which is impossible because basis only has 2 elements..
the error occurs at line 6, when you itterate the basis index
LG
on 30 Apr 2015
Søren Jensen
on 30 Apr 2015
Edited: Søren Jensen
on 30 Apr 2015
i do not know the whole code, so i can't know what you want to do exactly, but:
"basis(i+1)" cannot be higher than "basis(2)" because you only have 2 elements in the basis vector.. Therefore the only possible values of "i" is 0 and 1.
if you want to iterate i further than 1 in the code you gave your basis vector must be longer.
If you don't want your basis vector to be longer than 2 you have to think about the logic in your iterations.
Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!