How can I input equations with multiple variables?
Show older comments
Hello there guys;
I'm working on a problem where user is being asked for number of equations he wants to give to code to solve them. e.g. if user gives us n = 2, then there would be maximum 2 variables and equations. if user gives us n = 3, then would be 3 equations with 3 different variables. I'm facing issues with it and I'm using
F = eval(['@(x1,x2))',input("Write function f(x1,x2,...xn): ",'s')]);
but as we can see, I need to increase numbers of varables manually ( x1, x2 in this line ). But I want to make it much flexible and it can take any number of equations with any numbers of variables ( of course number of equtions would be equal to number of variables.
Accepted Answer
More Answers (0)
Categories
Find more on File Operations 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!