Speed differences in sym and vpa
이전 댓글 표시
I am working on an optimization problem that involves calling the Symbolic Math toolbox. The sym function makes optimization very slow, so I tried vpa and it made it a lot faster. I am wondering where the speed difference comes from? Is it the fact that sym converts everything to rational form while vpa doesn't? If so, should sym(x,'d') do the same thing as vpa(x) because now they're in the same form?
Thanks!
채택된 답변
추가 답변 (1개)
Alan Weiss
2013년 10월 11일
0 개 추천
I recommend using matlabFunction for optimizing symbolic variables and functions. There is an extensive example here, and another example here.
Alan Weiss
MATLAB mathematical toolbox documentation
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!