x =
Should Unity Value be Displayed when Multiplied by a symunit?
显示 更早的评论
The following results look peculiar IMO. Shouldn't a unit always be preceded by a value? I've never seen this convention before.
u = symunit;
mps = u.meter/u.sec;
x = 1*mps
x = reshape(1:4,2,2)*mps
4 个评论
Furthermore,
u = symunit;
C = u.Celsius;
F = u.Fahrenheit;
K = u.K;
x = [0*C, 0*F, 0*K]
"Shouldn't a unit always be preceded by a value?"
Yes. If I measure one volt then I would write "1 V". Lets try:
u = symunit;
x = 1 * u.V
y = 0.5 * u.V
z = 2*y % !!!
The documentation does state "1 represents a dimensionless unit. Hence, isUnit(sym(1)) returns logical 1 (true)", but it is unclear to me if that has any bearing on the observed behavior.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 App Building 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

