Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline RFreund  
#1 Posted : 07 December 2014 21:28:00(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
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

File Attachment(s):
Type conversion error - 1x1 Matrix.sm (8kb) downloaded 34 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline brotjob  
#2 Posted : 07 December 2014 23:53:48(UTC)
brotjob


Rank: Advanced Member

Groups: Registered
Joined: 18/09/2014(UTC)
Posts: 71
Switzerland

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.
Offline Davide Carpi  
#3 Posted : 08 December 2014 02:57:41(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,654
Man
Italy
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
Offline RFreund  
#4 Posted : 08 December 2014 03:12:58(UTC)
RFreund


Rank: Advanced Member

Groups: Registered
Joined: 25/09/2013(UTC)
Posts: 325
United States
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.
Offline Davide Carpi  
#5 Posted : 08 December 2014 03:51:36(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,654
Man
Italy
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
Users browsing this topic
Guest
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.