Symbolic Dot Product Of Symbolic 3D Vectors
47 次查看(过去 30 天)
显示 更早的评论
I have three 3d symbolic vectors, du, dv, dvv, which I initialize as
duu = sym('duu', [3,1])
...
I then calculate
N = cross(du,dv) / norm(cross(du,dv))
which gives me a resulting 3,1 vector as one would expect.
Now I want to do the symbolic dot product of (N, duu), however if I run
E = dot(N,duu)
the answer contains a load conj.
How to do I enforce that the result for E is a vector of real symbolic variables, not complex ones?
0 个评论
回答(1 个)
Steven Lord
2017-3-15
Tell Symbolic Math Toolbox to assume that your symbolic objects are real either when you construct them:
duu2 = sym('duu2', [3,1], 'real')
dot(duu2, duu2)
or after they are constructed using assume or assumeAlso.
duu3 = sym('duu3', [3,1])
assume(duu3, 'real')
dot(duu3, duu3)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assumptions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!