x =
Should Unity Value be Displayed when Multiplied by a symunit?
Show older comments
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 Comments
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.
Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
