Extract operations from symbolic expression
12 ビュー (過去 30 日間)
given a symbolic expression, I want to extract the fundamental operations that take place in this symbolic expression. In the end, I want to create a Simulink model that does the same as the symbolic expression but without a simple matlab function block but with basic simulink blocks. For that, I need to know what happens to the inputs and in what order.
I have the symbolic expression z = cos(x)*y + y^2.
How exactly do I get the necessary information from the sym object? I want to extract that the cosine of x is computed which is then multiplied with y and then this product is added to the square of y.
Are there any built-in function that can help me with this? So far, the only solution I could think of was to parse the string generated by "simscapeEquation(z)"
Thanks so much!
Paul 2023 年 1 月 28 日
What's the objection to using a Matlab Function block? If that wasn't a constraint, you could use matlabFunctionBlock
Even if you break down the expression, what would be the next step for implementing all of the individual Simulink blocks to rebuild the expression in Simulink?
その他の回答 (0 件)
Find more on Conversion Between Symbolic and Numeric in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!