Units not simplified in Matrices

Units not simplified in Matrices - Units are not simplified (i.e. to ohms etc) from the base SI units, when they are in matrices. - Mensajes

#1 Publicado: 25/8/2020 2:07:36
henry crun

henry crun

0 me gusta en 34 mensajes.

Grupo: User

Units are not simplified (i.e. to ohms etc) from the base SI units, when they are in matrices.
This means that I can't really use a vector to return tuples from a function or display numbers with mixed units, as the units become unrecognisable.

btw, is there an easy way to copy the smath region, and paste it into this?

Smath_Units_Matrices_Bug1.png

#2 Publicado: 25/8/2020 4:36:38
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Hi. This is my workaround: in the unit placeholder put diag([unit1, unit2, unit3]^T)

Clipboard01.jpg

Best regards.
Alvaro.
A 2 usuarios les gustó este mensaje
sergio 25/8/2020 5:13:00, Martin_B 25/8/2020 9:21:00
#3 Publicado: 25/8/2020 8:00:33
henry crun

henry crun

0 me gusta en 34 mensajes.

Grupo: User

That's a very twisted solution!
Here's the catch: I want to return a tuple of two values where I don't know what the units will be.

I thought num2str() might be able to help me just return printable strings, but it also returns the expanded base units.
num2str(2.3ohm)="{23*'kg*'m^2}/{10*'A^2*'s^3}"
#4 Publicado: 25/8/2020 8:13:01
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

Wrote

...
Here's the catch: I want to return a tuple of two values where I don't know what the units will be.
...



Hi. If you want the string with the value and the unit, try this: with this post ( https://en.smath.com/forum/yaf_postst17763_Dimensions-utility.aspx ) you can seek the dimensions of an unit, further, you can add a column in the 'Dimensions matrix with the unit as string for each one dimension and return it in some function UnitString, instead the dimension name.

Or can use this if don't want to work with strings:

Clipboard01.jpg

Best regards.
Alvaro.
  • Nuevos mensajes
  • Sin mensajes nuevos