Extracting variables from symbolic expression in a matrix form
1 次查看(过去 30 天)
显示 更早的评论
I have a long equation in symbolic math toolbox which has the following form:
A*u1+B*u2+C*u3
A, B and C are long relationships consisting of symbolic variables. I would like to extract the A B C in from u1, u2 and u3 and write them in a matrix form. In other words I would like to shape a relationship such us
[A B C]*{u}
where u is
u=[u1;u2;u3]
How can I do that?
0 个评论
采纳的回答
Walter Roberson
2013-4-29
2 个评论
Walter Roberson
2013-4-29
If you define k before you define h, then I think it might display in the shorter form.
syms h a b
k = c1*h +c2*h+c3*h;
h = a + b;
disp(k)
更多回答(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!