How to convert a symbolic variable to an ordinary variable?
Afficher commentaires plus anciens
Hello. I have some code that looks like this (it's not that simple but the problem can be reduced to the following lines):
syms x y real;
A = [x y; 1 2];
for i = 1:10
x = i;
y = 2;
B = subs(A) % could also be: B=eval(A)
end
Is there a way i can make x and y ordinary variables again? Eval and Subs are too slow and consume 95% of runtime.
I use symbolic variables because in my code I get A by differentiating some expressions. After that A doesn't change anymore and I only want to evaluate A for different values of x and y.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!