1 страниц (5 вхождений)
Type conversion error - Min() function - comparing matrix to non-matrix value - Сообщения
#1 Опубликовано: 07.12.2014 15:28:00
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
Type conversion error - 1x1 Matrix.sm (7 КиБ) скачан 61 раз(а).
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
Type conversion error - 1x1 Matrix.sm (7 КиБ) скачан 61 раз(а).
#2 Опубликовано: 07.12.2014 17:53:48
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.
#3 Опубликовано: 07.12.2014 20:57:41
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.
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 please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Опубликовано: 07.12.2014 21:12:58
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.
Thanks for the comments. So I guess in general I should probably try to avoid having 1x1 matrices.
#5 Опубликовано: 07.12.2014 21:51:36
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 please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 страниц (5 вхождений)
-
Новые сообщения
-
Нет новых сообщений