I couldn't find a similar question so I decided to ask this one. I have a nested list with many sublists of equal length. To make things easier let's say it's like that:
list={{2,1,7},{3,9,5},{4,8,6}}
I'd like to get a list of last elements from each sublist, in this case:
{7,5,6}
I'm not sure whether i should think of a pattern to do this or is there a simpler way?
Last /@ list
2.list[[All, -1]]
3.list /. {___, i_Integer} :> i
$\endgroup$ – rm -rf♦ Jan 27 '14 at 16:53list[[;; , -1]]
$\endgroup$ – RunnyKine Jan 27 '14 at 16:55Transpose[list][[-1]]
$\endgroup$ – C. E. Jan 27 '14 at 16:55