Please help with this
5 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153761/image.png)
hi i need help writing a code that will allow the user to choose which of each of the intersections the user wants to solve for. these are the equations:
1: 100 + 200 = f1 + f3 or f1 + f3 = 300 (1)
2: 300 + f1 = f2 + f4 or −f1 + f2 + f4 = 300 (2)
3: f5 + f2 = 100 +500 or f2 + f5 = 600 (3)
4: f3 + f6 = 100 +300 or f3 + f6 = 400 (4)
5: f4 +f7 = f6 +200 or f4 − f6 + f7 = 200 (5)
6: 200 + 400 = f5 + f7 or f5 +f7 = 600 (6)
2 个评论
Roger Stafford
2013-12-17
Victor, you have seven unknowns and only six equations, so even if you use all six equations, they do not uniquely determine a solution - that is, there will be an infinite continuum of solutions. You need one more equation before you can obtain a unique solution.
回答(2 个)
Walter Roberson
2013-12-17
1 个评论
Walter Roberson
2013-12-18
As I read it, you need to allow the user to indicate a list of flows (each f1 to f7) and corresponding traffic volumes. Then, list entered, analyze to see whether the user has given enough information to solve the flows exactly; if not, say so and go back to the beginning. If the user gave too much information or gave flow measurements that make the whole system impossible, then say so and go back to the beginning. If the user gave just the right amount of information and it is not contradictory, spit out the list of all of the traffic flows; and then go back to the beginning.
Roger Stafford
2013-12-18
I will give you one more hint on your problem, Victor. The part of the problem statement that says " according to the dimension and rank of the matrix " is an important indication of how you should proceed in writing your requested program. You need to figure out what matrix they are referring to and write your program to proceed accordingly.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!