I understand you can add onto the end of a list like this

Code:
5→L1(1+dim(L1

However, how can I do that with a matrix? I already have all the values in another row of a matrix that I'm trying to copy over to a new row

[F]{3,1,1,3,5,5,.1,4},{3,2,1,1,3,1,0,8},{3,3,1,3,7,7,.25,2},{3,4,1,5,3,.02,6},{3,5,7,10,6,1,.15,1}
I want to Copy Row X of [F] over to [C] but Row X is added onto the end of [C]
You can transpose the source matrix and then use matr>list() to get the Xth row of your matrix into a list, then you can transpose the destination matrix and use augment() to add the newly made list to the last column of and re-transpose it so that the columns become rows again.
I think the following code should do the trick (note that you need an extra matrix variable to store the intermediate matrix to because List►matr needs to put the matrix somewhere)

Code:
Matr►list([F]τ,X,L1
List►matr(L1,[D]
augment([C]τ,[D])τ→[C]

If you know the dimensions of the matrices beforehand, you could also do it with seq() which would be faster because all of these matrix commands are pretty slow.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement