Symbolic transpose of a matrix with the dimension not defined
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to work with symbolic variables in Matlab but I have a little problem. I want to work with general expressions without specify the dimensions of the matrix. For example if I define A as a symbolic variable and I use "transpose(A)" I want to receive "transpose(A)" and not this:
>> syms A
transpose(A)
ans =
A
>> A = sym('a',[3 3]);
transpose(A)
ans =
[ a1_1, a2_1, a3_1]
[ a1_2, a2_2, a3_2]
[ a1_3, a2_3, a3_3]
I have a huge expression that I want to simplify later with the command "simplify".
Thank you in advance, Álvaro
0 个评论
回答(1 个)
Walter Roberson
2016-4-7
Perhaps define a symbolic function Tr(M) without giving a definition for it, and apply it as needed. When it comes time to substitute actual matrix dimensions for A, you can also substitute a transpose function for Tr which would trigger the transposes.
2 个评论
Walter Roberson
2016-4-8
horner cannot do much unless it finds something that looks like a monomial . It does not take much to throw off horner.
Often more useful than horner() is collect()
But I would need to see more of the structure of your expression to say more.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!