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. - Сообщения

#1 Опубликовано: 25.08.2020 02:07:36
henry crun

henry crun

0 сообщений из 34 понравились пользователям.

Группа: 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 Опубликовано: 25.08.2020 04:36:38
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

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

Clipboard01.jpg

Best regards.
Alvaro.
2 пользователям понравился этот пост
sergio 25.08.2020 05:13:00, Martin_B 25.08.2020 09:21:00
#3 Опубликовано: 25.08.2020 08:00:33
henry crun

henry crun

0 сообщений из 34 понравились пользователям.

Группа: 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 Опубликовано: 25.08.2020 08:13:01
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: 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.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений