How can I generate a matrix of symbolic functions, whose size varies depending on the input values?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yaswanth Sai
am 3 Nov. 2018
Kommentiert: Yaswanth Sai
am 6 Nov. 2018
For example, I want to generate 4 symbolic functions which depend on the variable 't'. They should be something like th1(t), th2(t), th3(t), and th4(t). It's easy to define these variables when the number of variables is less and that number is constant. How can I automatically get a matrix of functions whose size may vary?
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 3 Nov. 2018
Bearbeitet: madhan ravi
am 3 Nov. 2018
It’s highly discouraged.
if you still insist doing it then see
13 Kommentare
Walter Roberson
am 5 Nov. 2018
Use a cell array of symbolic functions.
TH = sprintfc('th%d(t)', 1:n);
funs = arrayfun( @(th) sym(th), TH, 'uniform', 0);
Now funs{1} through funs{n}
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!