Printing syms / matlabFunction slow
显示 更早的评论
Hi all,
I am having a lot of trouble trying to make my symbolic code go faster.
I am creating a complicated function f, and calculating its jacobian df. This goes at a reasonable pace, and I can save it to a file just fine. But when I try to use matlabFunction or even disp or fprintf, the system hangs and is unable to proceed further (even when matlabFunction is set to unoptimized). This is a major problem as I need to be able to do reasonably fast substitution.
The f vector is 24 elements, and the Jacobian is 24 x 78 (there are only 70 variables that show up here though, so this could be compressed down to 70 columns; I doubt this is the issue though).
I also know that certain elements which are simple work fine, but certain, more complicated elements of f and df cannot be displayed. I imagine they are very long, but since they are calculated just fine, it doesn't make sense to me that they cannot be transformed into a matlabFunction or displayed.
Even more bizarrely, I can substitute in for all my symbolic variables, but then the final display of the fully substituted f vector, or the conversion to double seems to take forever.
I'm attaching the file. What can I do to write out this file in a reasonable amount of time?
Thank you for your time.
3 个评论
Steven Lord
2015-10-15
I don't see any attached file.
Andrew Spielberg
2015-10-15
Joel Rosenfeld
2018-5-3
I'm facing the same issue with matlabFunction. Did you ever get this resolved?
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Code Performance 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!