Hi. I've been looking all over the web trying to find if there's an easy way to reference a row, or column (or rows or columns) of a matrix.

I know you can reference the top right element with [A](1,1), for instance. But what if I want the top row of [A]?

Also, is there a way to delete a column, or row, of a matrix? And could I substitute some values for just one row (or column) of a matrix? Or insert a row or column?

I'm studying math, taking Linear Algebra and some other subjects (Linear Programming) which require many calculations of matrices which are similar to each other and it's tiring always going into the editor to change one row/column, and it's difficult to delete a row/column from the middle of the matrix, etc.

If anyone knows an easy way to do this, I'd love to hear it.

Thanks.
You can use the Matr►list() command to convert a column of a matrix to a list. If you want a row, just take the transpose (the superscript T) of the matrix, then use Matr►list().
*bump* I can only assume that like the rest of us, you're a busy guy, but I hope this has helped you. Also, I think this is relevant to Merth.
Yes, I was busy studying for a test. It did help me - in fact, on the very test I was studying for (an operations research test).

But I guess what I really need is a way to, say, remove rows or columns, or add rows or colums, easily.

I did use your technique. I copied the matrix I was using to L1, L2...Ln. Used the list editor to remove the first entry of every list, then copied the lists back to a matrix. This reduces silly, stupid errors (which I, like every math student I've ever met, am prone to).

Thanks.
To insert a 1-row matrix [B] into matrix [A] so that it occupies row R, with subsequent rows shifted down:

Code:
:augment([B]^T,[A]^T)^T→[A]
:For(R,1,R-1
:rowSwap(Ans,R,R+1→[A]
:End


To delete row R from matrix [A], with subsequent rows shifted up:

Code:
:dim([A]→L1
:For(R,R+1,Ans(1
:rowSwap([A],R-1,R→[A]
:End
:{R-2,L1(2→dim([A]


To modify a column instead, use the transpose function—[2nd] [x-1] [►] [2]—on a matrix, use this transposed matrix as the input for one of the above programs, then transpose the [A] that comes out of it.
That's our Weregoose! I feel that that should go in the Useful Routines thread somewhere; I'll have to do that later.
To get an entire row of a matrix simply reference by matrix[number] where number is the number of the row you want to get .

I haven't been able to get an entire column...
CharlieMAC wrote:
To get an entire row of a matrix simply reference by matrix[number] where number is the number of the row you want to get .

I haven't been able to get an entire column...


Transpose the matrix and then use matrix[columnnumber] to get the column.
SWEEET!!! Thanks a lot Smile
CharlieMAC wrote:
SWEEET!!! Thanks a lot Smile
Welcome to Cemetech, and thank you for re-using a relevant thread to your particular question!
Greetings, I've just created this account just to ask if this is possible in the Ti Nspire CAS:

"To delete row R from matrix [A], with subsequent rows shifted up:"

The problem I encounter is that i doesnt get the " :{R-2,L1(2→dim([A] " Part. So im here trying to know if you guys know a workaround for this?
Thanks for posting about this!!
I've been looking for a way to do this and I was naive and didn't take the time to understand how matrix functions work. After reading this I have looked into it more and it has helped me learn a lot. Idea
  
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