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
 compsystems Senior Member Posts: 1,384 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 Messages In This Thread CONCAT/APPEND/PREPEND CAS FUNCTION - compsystems - 07-30-2016, 03:08 AM RE: [Request] fill zeros in vectors and matrices with empty elements - parisse - 07-30-2016, 07:51 AM RE: - compsystems - 07-30-2016, 12:37 PM RE: - compsystems - 07-30-2016, 12:33 PM RE: [Request] fill zeros in vectors and matrices with empty elements - parisse - 07-30-2016, 01:33 PM RE: - compsystems - 07-30-2016, 02:12 PM RE: - compsystems - 07-30-2016 02:47 PM RE: CONCAT/APPEND/PREPEND CAS FUNCTION - parisse - 07-30-2016, 04:50 PM RE: CONCAT/APPEND/PREPEND CAS FUNCTION - Tim Wessman - 08-01-2016, 08:46 PM RE: CONCAT/APPEND/PREPEND CAS FUNCTION - compsystems - 08-01-2016, 11:40 PM RE: CONCAT/APPEND/PREPEND CAS FUNCTION - Tim Wessman - 08-02-2016, 04:04 PM

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