HP Forums
problems with MAKEMAT - 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: problems with MAKEMAT (/thread-7473.html)



problems with MAKEMAT - compsystems - 12-26-2016 10:59 PM

Hello

CAS MODE

MAKEMAT(0,10); -> Error: Bad Argument Type" Why?
makemat(0,10); -> [[]] Why?
makeMat(0,10); -> [0,0,0,0,0,0,0,0,0,0]; // ok =)


RE: problems with MAKEMAT - Han - 12-28-2016 02:41 AM

This was discussed in depth in another thread a long while back. There are two versions: MAKEMAT and makemat and they take different arguments since 'makemat' is a CAS-only command (with the only exception being a "constant" function). makemat( cas-function, width, height )

Example: makemat( (x,y)->x+2*y, 3, 4 )

Creates a 3x4 matrix whose \( i,j \)-th entry is \( i+2j \)

EDIT: While we are at it, MAKELIST and makelist are similarly different.


RE: problems with MAKEMAT - compsystems - 12-28-2016 01:29 PM

I hope that google translator is correct

It is a fact that there are two versions of several commands, but in my first post I show that there are 3 versions, this complicates the coding, Do you agree?

Or at least this should be shown in HELP, if the development group does not incorporate user contributions, we are wasting time.

I hope that in a future version complete functions and commands on catalog help.

CAS MODE
makemat(0,1,10) -> [[0,0,0,0,0,0,0,0,0,0]] // Two Dimensional (i,j) // ok
makeMat(0,10) -> [0,0,0,0,0,0,0,0,0,0] // One-dimensional (i) // ok
makemat(0,10); -> [[]] // I think I should throw [0,0,0,0,0,0,0,0,0,0], To remove the third option command with M middle capital, at let's wait and see what the Mr Bernard says.

makemat(x->0,10) -> "Error: Bad Argument Value" -> [0,0,0,0,0,0,0,0,0,0]
makemat(x->0,1,10) -> [[0,0,0,0,0,0,0,0,0,0]] // ok

HOME MODE
MAKEMAT(0,1,10) -> [0,0,0,0,0,0,0,0,0,0] // ok
MAKEMAT(0,10) -> [0,0,0,0,0,0,0,0,0,0] // ok
CAS MODE
MAKEMAT(0,1,10) -> [[0,0,0,0,0,0,0,0,0,0]]
MAKEMAT(0,10) -> "Error: Bad Argument Type" -> [0,0,0,0,0,0,0,0,0,0]

Now with MAKELIST

HOME MODE
MAKELIST(X,X,5,10); ->{5,6,7,8,9,10} // ok
MAKELIST(0,X,1,10); -> {0,0,0,0,0,0,0,0,0,0} // ok
MAKELIST(0,X,10); -> "Error:" -> {0,0,0,0,0,0,0,0,0,0} // ok
CAS MODE
MAKELIST(0,X,1,10); -> {0,0,0,0,0,0,0,0,0,0} // ok
makelist(0,X,10); -> [0,0,0,0,0,0,0,0,0,0,0] // ok
makelist(0,X,1,10); -> [0] // ??? -> [[0,0,0,0,0,0,0,0,0,0]]


RE: problems with MAKEMAT - Han - 12-28-2016 02:42 PM

I don't think there are three versions. There is either makemat, or MAKEMAT. Anything else is automatically converted to MAKEMAT. So makeMat, MaKeMaT, etc. are all the same as MAKEMAT. Only makemat is different.

I believe Tim already responded with their intentions to remedy this issue in a different post of yours (on essentially the same topic).