Post Reply 
problem with mat2list (8151)
10-20-2015, 06:24 PM
Post: #1
problem with mat2list (8151)
Sometimes, after many executions attached function, the command mat2list stops working. Then after run this function the following error: "Error: bad argument type". Calling the mat2list([[1],[2],[3]]) or mat2list([1,2,3]) generates the error: "Stopped by user interruption. Error: Bad Argument Value".

The problem disappears after you reset the calculator by Symb+On.

Recently, this problem appeared after pressing On when the calculator was looking for extremum of a function bladNamiarow (X,45,8000,M1) in Function App

bladNamiarow is part of a larger program and most of the time working properly.


Attached File(s)
.zip  bug mat2list (8151).zip (Size: 20.1 KB / Downloads: 3)
Find all posts by this user
Quote this message in a reply
10-20-2015, 07:15 PM
Post: #2
RE: problem with mat2list (8151)
mat2list is a CAS command. Your program is a non-CAS program. It is quite possible to write programs that will interrupt a CAS command as it is processing. When this happens, the error message (program interrupted) from the Home side gets "attached" to CAS command and from thereon out, the command will only return the error string.

Rather than On-Symb, an alternate workaround is to simply use mat2list() on a simple list, and evaluate it in the CAS view. In the CAS view, mat2list() should process the list correctly, and mat2list will work normally again moving forward.

I have had this happen with the QR command, which in turn also affects the EIGENVV, and related commands (i.e. all commands that use the routines within the QR command).

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
10-21-2015, 04:35 PM
Post: #3
RE: problem with mat2list (8151)
I wrote my own command "MAT2LIST" which is faster than the original mat2list in non-CAS program.

EXPORT MAT2LIST(m)
BEGIN
LOCAL l:={},w,k,t,i,j;
J▶j;
DIM(m)▶t;
IF SIZE(t)==2 THEN
t(1)▶w;
t(2)▶k;
FOR i FROM 1 TO w DO
CONCAT(l,MAKELIST(m(i,J),J,1,k))▶l
END
ELSE
t(1)▶k;
MAKELIST(m(J),J,1,k)▶l
END;
j▶J;
l
END;
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)