How can I input equations with multiple variables?
古いコメントを表示
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!