Post Reply 
Create a matrix
01-26-2019, 03:18 PM
Post: #3
RE: Create a matrix
Thank you for your suggestions!

Something interesting happens when I copy from your post, into the [CAS] (emulator):
MAKEMAT(IFTE(I=J,2,IFTE(J=I-1 OR J=I+1,-1,0)),5,5) :

CAS changed changed all of the IFTE()'s to when()'s:
MAKEMAT(when(I=J,2,when(J=I-1 OR J=I+1,-1,0)),5,5)

Then I recalled that result to the command line, it changed all of the when()'s to:
MAKEMAT(((I = J)? 2 : (((J = (I-1)) OR (J = (I+1)))? -1 : 0)),5,5)

I've never seen that last format before, on the prime. Maybe an XCAS shorthand?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Create a matrix - DrD - 01-26-2019, 11:19 AM
RE: Create a matrix - JMB - 01-26-2019, 12:00 PM
RE: Create a matrix - DrD - 01-26-2019 03:18 PM
RE: Create a matrix - JMB - 01-26-2019, 05:49 PM



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