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 - Messages

#1 Posted: 3 years ago
kratikus

kratikus

0 likes in 1 posts.

Group: 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 Posted: 3 years ago
sergio

sergio

115 likes in 329 posts.

Group: User

Watch this discussion (Razonar provided good suggestions)

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

sergio
#3 Posted: 3 years ago
overlord

overlord

558 likes in 1,335 posts.

Group: 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 KiB) downloaded 83 time(s).

2022-06-11_00-42.png
2 users liked this post
Martin Kraska 3 years ago, sergio 3 years ago
#4 Posted: 3 years ago
Martin Kraska

Martin Kraska

1,230 likes in 2,156 posts.

Group: Moderator

Very smart use of multiplicative split of result display!
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#5 Posted: 3 years ago
overlord

overlord

558 likes in 1,335 posts.

Group: 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 users liked this post
sergio 3 years ago
#6 Posted: 3 years ago
Jean Giraud

Jean Giraud

983 likes in 6,866 posts.

Group: User

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

Electric(V,R).PNG
  • New Posts New Posts
  • No New Posts No New Posts