SMath Studio Forum
»
SMath Studio
»
Questions
»
Type conversion error - Min() function
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(s)
|
See attached file. For some reason if you have a normal value call it NV and a value in a 1x1 matrix, you recieve odd type conversion erros when you try to compare them using Min, Max, etc.... maybe though I don't understand why? i.e Min(NM-M1x1, M1x1) = receive error
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 18/09/2014(UTC) Posts: 71 Was thanked: 7 time(s) in 7 post(s)
|
I think Smath is handling this in a general style. You can't do min() on two matrices because matrices don't have a size you could compare. You can do min(det(MatrixA);det(MatrixB )) but anyway you compare scalars. In other words I am surprised that Min(2*'in,mat(8*'in,1,1)) works but not that Min(12*'in-mat(2*'in,1,1),mat(8*'in,1,1)) doesn't. I am an engineer and as such try to avoid matrices. Keep it simple where you can.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
I know this issue.
There are several small drawbacks working with preprocessing and pure low-level functions; the main problem is to recognize if the argument is a number, a matrix or a system and sometimes the preprocessing/symbolic calculation doesn't output the matrix/system as outer element. This is one of the cases.
I'm trying to find an easy solution (in the end a custom preprocessing function) but there are several things to consider, and obviously requires a little bit of time. |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 25/09/2013(UTC) Posts: 325 Location: IL Was thanked: 19 time(s) in 17 post(s)
|
I see, thanks for the comments. I too am an engineer and mostly only use the matrices for 'data storage' in scripts. So I tend to forget or miss-understand how Smath is treating such items.
Thanks for the comments. So I guess in general I should probably try to avoid having 1x1 matrices.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
You're welcome. This is just a problem of plugins and preprocessing. If calculations are made outside the function (not in the argument placeholder) you should skip these issues. |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Type conversion error - Min() function
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.