How to convert a symbolic variable to an ordinary variable?
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!