Using symbolic solve in matlab with maple symbolic toolbox, How to assign values to symbolic expressions and get numerical answer.
6 次查看(过去 30 天)
显示 更早的评论
I asked this question last week and got the answer: http://mathworks.com/matlabcentral/answers/17155-want-to-use-solve-with-non-symbolic-variables#answer_23124
This worked perfectly, however, when I used the actual function I want to solve 'solve' couldn't find a solution. Fortunately, I switched to the Maple symbolic toolbox and it solved the function. Now, though I can't use the method in the previous answer. Any ideas? I want to give values to a b and c and get a solution.
Thanks,
Chris
0 个评论
采纳的回答
Walter Roberson
2011-10-3
Do you have access to Maple itself? If so, copy the general expression in to it, solve() it, and then use Maple's CodeGeneration[Matlab] to create the corresponding MATLAB routine. You can also invoke this functionality within MATLAB if you have the Extended Symbolic Toolbox, but not if you have only the regular Symbolic Toolbox.
If the form of the function keeps changing or it is otherwise not possible or practical to use Maple's CodeGeneration routines, then to put specific numeric values in for constants, subs() the values in for the constants in the expression. You will probably wish to double() the symbolic numeric expression that results.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!