Turn inequalities into equalities
이전 댓글 표시
This must be done symbolically, so I am considering other languages.
Given a set/list/array of inequalities- {2x >= y, 2z >= y, 2x+y <= 4, 2z+y <= 4}
I would like to be able to set certain equations equal. In this example, lets set equations 1 and 3 equal generating-
2x=y & 2x+y=4.
How can I assign the coefficients in the inital list to a matrix?
답변 (1개)
Azzi Abdelmalek
2015년 7월 15일
syms x y z
eq={2*x >= y, 2*z >= y, 2*x+y <= 4, 2*z+y <= 4}
out=cellfun(@(x) sym(regexprep(char(x),'<=|>=|<|>','=')),eq([1 3]),'un',0)
celldisp(out)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!