Post Reply 
CONCAT/APPEND/PREPEND CAS FUNCTION
07-30-2016, 02:47 PM (This post was last modified: 07-30-2016 05:01 PM by compsystems.)
Post: #7
RE:
Now I am using the APPEND/PREPEND CAS FUNCTION,

Case 1:
mat1 := [[a,b],[c,d]] [Enter] returns [[a,b],[c,d]] Matrix (2rowsx2cols) OK
vec0 := [[1,2]] returns [[1,2]] Matrix (1rowx2cols) or AKA Row Vector (2 Elements) OK
append(mat1,vec0) returns [ [a,b], [c,d], [[1,2]] ] ok
prepend(mat1,vec0) returns [ [[1,2]], [a,b], [c,d]] ok

Case 2:
mat1 := [[a,b],[c,d]] [Enter] returns [[a,b],[c,d]] Matrix (2rowsx2cols) OK
vec1 := [[1],[2]] [Enter] returns [[1],[2]] Matrix (2rowsx1col) or AKA Column Vector (2 Elements) OK


APPEND

append(mat1,vec1) [Enter] returns [ [a,b], [c,d], [[1],[2]] ] OK a list of 3 elements
string(append(mat1,vec1) ) [Enter] returns ""[ [a,b], [c,d], [[1],[2]]]"" OK
dim(append(mat1,vec1)) [Enter] returns 3 elements OK

PREPEND

prepend(mat1,vec1) [Enter] returns [ [[1],[2]], [a,b], [c,d] ] ok a list of 3 elements
string(prepend(mat1,vec1)) returns "[ [[1],[2]], [a,b], [c,d] ]"
dim(prepend(mat1,vec1)) [Enter] returns [3,2] ???

Case 3:
mat1 := [[a,b],[c,d]] [Enter] returns [[a,b],[c,d]] Matrix (2rowsx2cols) OK
list5 := [1,2] [Enter] returns [1,2] List (2 Elements) OK

append(mat1,list5) [Enter] returns [[a,b],[c,d],[1,2]] OK
dim(append(mat1,list5)) [Enter] returns [3,2] ok

prepend(mat1,list5) [Enter] returns [[1,2],[a,b],[c,d]] OK
dim(prepend(mat1,list5)) [Enter] returns [3,2] ok
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: - compsystems - 07-30-2016, 12:37 PM
RE: - compsystems - 07-30-2016, 12:33 PM
RE: - compsystems - 07-30-2016, 02:12 PM
RE: - compsystems - 07-30-2016 02:47 PM



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