cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How can one choose the last column of a matrix?

MortezaA
1-Newbie

How can one choose the last column of a matrix?

I have a matrix that might change size in every particular run and I need the program to automatically plot the last column versus some other variable.but I cant choose the U<no. of column> command since I don't know how big my matrix is gonna be this time

1 ACCEPTED SOLUTION

Accepted Solutions

Use

UCols1.png

or if you changed ORIGIN you should use

Ucols2.png

View solution in original post

5 REPLIES 5

Use the cols() function.

Use

UCols1.png

or if you changed ORIGIN you should use

Ucols2.png

MikeArmstrong
5-Regular Member
(To:MortezaA)

Another approach. Overkill I know but couldn't resist. At least you know have the ability to extract rows from Matricies.

Clipboard01.jpg

Mike

To complete it add an additional transpose at the end.

Overkill? 🙂 Think we have a new example to explain what an euphemism is

The transpose-column extract-transpose way work pretty well, but with large matrices an in side a loop it gets terribly slow. Generally its surprising that the built in matrix routines are much slower than self written routines using for-loops - especially augment and stack. One would expect the opposite. This was discussed and timed in an older thread and really was astonishing.

MikeArmstrong
5-Regular Member
(To:Werner_E)

Werner Exinger wrote:

To complete it add an additional transpose at the end.

Overkill? 🙂 Think we have a new example to explain what an euphemism is

Sorry, was a little lazy of me.

The transpose-column extract-transpose way work pretty well, but with large matrices an in side a loop it gets terribly slow. Generally its surprising that the built in matrix routines are much slower than self written routines using for-loops - especially augment and stack. One would expect the opposite. This was discussed and timed in an older thread and really was astonishing.

I remember that thread and you are correct the results where astonishing.

Mike

Top Tags