How do you create multiple symbolic variables?

19 vues (au cours des 30 derniers jours)
Richárd Tóth
Richárd Tóth le 2 Août 2019
Modifié(e) : madhan ravi le 2 Août 2019
Here is my code, but is there a simpler solution?
% create symbolic variables x1,...,xn
for i=1:n
eval(join(['syms x' string(i)],''));
end

Réponse acceptée

madhan ravi
madhan ravi le 2 Août 2019
Modifié(e) : madhan ravi le 2 Août 2019
n = 4;
X=sym('x',[1,n]);
syms(X)
If you're using 2019a or later:
n = 4;
syms x [1 n]

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by