problem with mat2list (8151) - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: problem with mat2list (8151) (/thread-4978.html) |
problem with mat2list (8151) - slawek39 - 10-20-2015 06:24 PM 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. RE: problem with mat2list (8151) - Han - 10-20-2015 07:15 PM 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). RE: problem with mat2list (8151) - slawek39 - 10-21-2015 04:35 PM 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; |