Magnitude of a vector with unit
3 次查看(过去 30 天)
显示 更早的评论
I am having a trouble getting the numerical value of the magnitude of a vector with a unit.
clearvars;
u=symunit;
x=[1 2 3]*(u.m);
norm(x)
x=[1 2 3];
norm(x)
x=[1 2 3]*(u.m);
y=[5 6 7]*(u.m);
z=norm(x)/norm(y)
vpa(z)
As it can be seen above, Matlab does not give me the numerical value of the magnitude when units are present.
0 个评论
采纳的回答
Paul
2023-3-12
u=symunit;
x=[1 2 3]*(u.m);
norm(x)
simplify(norm(x))
vpa(ans)
x=[1 2 3]*(u.m);
y=[5 6 7]*(u.m);
z=simplify(norm(x)/norm(y))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!