0

If we have a nested matrix as:

start={
{{1, 2, 2, 3}, {1, 1, -2, 1}, {3, 2, 2, -I}, {1, 2, 0, -I}}, 
{{3, 4, 4, 0}, {1, 1, 4, 1}, {3, 3, 4, -1}, {1, 1, 2, I}}
}

How can we choose the latest elements of sub_lists 3,1,-I,-I,0,1,-1,I and create of them a matrix as

final={{3,1,-I,-I},{0,1,-1,I}}
David G. Stork
  • 41,180
  • 3
  • 34
  • 96
Unbelievable
  • 4,847
  • 1
  • 20
  • 46
  • 1
    Please focus on answers you've already received. E.g. 104564. – Kuba Jan 22 '16 at 19:15
  • I tried to use of those answer I used final= Apply[{#4} &, start, {2}]; unfortunately I think I could not deeply understand that. @Kuba, are there good references for list manipulation (however Mr.Wizard introduced a link but I want to be familiar with a more practical documentation (containing practical examples) about list manipulation) – Unbelievable Jan 22 '16 at 19:22
  • 2
    @Arkaran, will you start to learn carefully from the answers that you receive? start[[;; , ;; , -1]] – garej Jan 22 '16 at 19:29
  • For example if I search Map(which is used by David G.Stork) in mathematica help I will see Map[f, {a, b, c, d, e}]={f[a], f[b], f[c], f[d], f[e]} I cannot understand what are a, b, c, .. are they sub_lists or each elements in sub_lists!!! Just in examples we can see what happen in list manipulation. – Unbelievable Jan 22 '16 at 19:30
  • 1
    @garej, thanks for your comment,, i can imagine, I must concentrate on answers. and try to learn their keys. – Unbelievable Jan 22 '16 at 19:33
  • @Ackaran, you may experiment with examples, i.e. make your own to try. Compare: Map[Style[f, Red], Thread[List[{a, b, c, d, e}, {a, b, c, d, e}]]] and Map[Style[f, Red], Thread[List[{a, b, c, d, e}, {a, b, c, d, e}]], {-1}] – garej Jan 22 '16 at 19:38
  • @Ackaran take a look here too: the most common pitfalls. Once you become familiar with list manipulation, MMA will be a lot of fun. – Kuba Jan 22 '16 at 19:40
  • @Ackaran, do not forget to check Map[Last, start, {-2}] – garej Jan 22 '16 at 19:49

1 Answers1

2

This works:

Map[Last, start, {2}]
David G. Stork
  • 41,180
  • 3
  • 34
  • 96