SMath Studio Forum
»
SMath Studio
»
Questions
»
Assign unit to a matrix element within a foor loop
Rank: Newbie
Groups: Registered
Joined: 10/06/2022(UTC) Posts: 1
|
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: I would like to change for example the Current and Power unity to mA and mW respectively. Thanks in advance
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 318 Location: italy Was thanked: 109 time(s) in 93 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,125 Was thanked: 506 time(s) in 337 post(s)
|
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 (4kb) downloaded 11 time(s).
|
2 users thanked overlord for this useful post.
|
on 11/06/2022(UTC), on 11/06/2022(UTC)
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,980 Was thanked: 1120 time(s) in 718 post(s)
|
Very smart use of multiplicative split of result display! |
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 1,125 Was thanked: 506 time(s) in 337 post(s)
|
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
|
1 user thanked overlord for this useful post.
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,868 Was thanked: 980 time(s) in 808 post(s)
|
You can make it algo style for in-situ command line.
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Assign unit to a matrix element within a foor loop
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.