Function to Linear equation with string input

2 views (last 30 days)
Hello.
I would like to make a function which can give the result of a linear equation system with 2 equations and 2 unknown. The function should receive 2 parametres for which every parameter is a string which contain a equation.
Like: y=2x+1 y=3x-2
The function should be like: Functionname('y=2x+1'.'y=3x-2') and should give result like a string with the result like 'x=3, y=7'
Both equation should be like the form of y=ax+b or y=ax-b
Anyone who can me?
  3 Comments
dpb
dpb on 29 Aug 2015
Alternatively, you could modify your goals a little and given that you have a fixed format for the equations simply enter the numeric coefficients of the terms and build the resulting system knowing the form. Somewhat easier first task; get that working then can expand on the knowledge gained there in Matlab to enhance the user interface...

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 29 Aug 2015

Categories

Find more on Symbolic Math Toolbox 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!