Post Reply 
MAKEMAT
07-17-2014, 10:06 AM
Post: #2
RE: MAKEMAT
(07-16-2014 10:42 PM)Alberto Candel Wrote:  Does it work in CAS? it seems so according to Help. But MAKEMAT(I+J,2,2) returns [[0,0],[0,0]], while MAKEMAT(i^2+j,2,2) returns [[j-1,j-1],[j-1,j-1]]. This is so because upper case letters are initialized to 0, lower case are not initilized, and lowercase i is sqrt(-1).

Any help? I cannot find any relevant documentation for this behavior in the user manual. Thanks.

MAKEMAT (must be spelled with uppercase letters in CAS) only works with the built-in real variables I and J, not with lowercase user variable j (or any other variables). So when using MAKEMAT in CAS, be sure to spell both its name and its I and J variables in uppercase, or it won't work as expected.

HOWEVER... Please note that makemat (spelled in lowercase) is a CAS-only function that uses a different syntax than MAKEMAT. In Home, makemat uses MAKEMAT's syntax (and is displayed in Home's history as MAKEMAT), but they are different in CAS:

Home: MAKEMAT(I^2+J,3,5) --> [[2,3,4,5,6],[5,6,7,8,9],[10,11,12,13,14]]
Home: makemat(I^2+J,3,5) --> [[2,3,4,5,6],[5,6,7,8,9],[10,11,12,13,14]]

CAS: MAKEMAT(I^2+J,3,5) --> [[2,3,4,5,6],[5,6,7,8,9],[10,11,12,13,14]]
CAS: makemat(I^2+J,3,5) --> [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0]]
CAS: makemat((x,y)->x^2+y,3,5) --> [[2,3,4,5,6],[5,6,7,8,9],[10,11,12,13,14]]

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
MAKEMAT - Alberto Candel - 07-16-2014, 10:42 PM
RE: MAKEMAT - Joe Horn - 07-17-2014 10:06 AM
RE: MAKEMAT - Alberto Candel - 07-17-2014, 01:31 PM
RE: MAKEMAT - Angus - 07-17-2014, 10:55 AM



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