Assign unit to a matrix element within a foor loop

Assign unit to a matrix element within a foor loop - Assign unit to a matrix element within a foor loop - 消息

#1 已发布: 2022/6/10 10:52:21
kratikus

kratikus

0个赞,共1个帖子。

组: User

Hi all,

This is my first post in here.
I was wondering whether it is possible to change the unit of a matrix element within a for loop.
Here is a small example:
Example

I would like to change for example the Current and Power unity to mA and mW respectively.

Thanks in advance
#2 已发布: 2022/6/10 11:51:27
sergio

sergio

127个赞,共342个帖子。

组: User

Watch this discussion (Razonar provided good suggestions)

https://en.smath.com/forum/yaf_postst18903_Units-not-simplified-in-Matrices.aspx

sergio
#3 已发布: 2022/6/10 18:44:50
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

Subjectively better looking version for Razonar's example.
Not very practical though, need to re-write for every new units.
I think this should be a feature, using a matrix units for matrix output.

This is how I wrote a pseudo 'matrix looking like' variable.

'\005B\ohm\0020\mA\0020\μV\005D\

Rest is copy paste to place holders.

Regards

matrixunits.sm (3.49 KiB)已下载 1292 次。

2022-06-11_00-42.png
2位用户喜欢此帖子
Martin Kraska 2022/6/11 04:18:00, sergio 2022/6/11 05:22:00
#4 已发布: 2022/6/11 04:18:53
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

Very smart use of multiplicative split of result display!
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
#5 已发布: 2022/6/11 07:55:17
overlord

overlord

600个赞,共1,381个帖子。

组: Moderator

I don't know if example below is posted before.
You can create multiline named variables too.
Same logic with post I wrote matrixed units.
Copy text below and paste into smath.

This\0020\is\0020\a\000A\multiline\000A\variable:10^3

2022-06-11_13-54.png
1位用户喜欢此帖子
sergio 2022/6/11 15:02:00
#6 已发布: 2022/6/11 09:34:30
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

You can make it algo style for in-situ command line.

Electric(V,R).PNG
  • 有新帖
  • 无新帖