Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I compute the row differences of an m x n matrix to obtain an m-1 x n matrix; that is, given

enter image description here

how do I obtain

enter image description here

share|improve this question
up vote 3 down vote accepted

Maybe this ?

m = {{a, b, c}, {d, e, f}, {g, h, i}};
(* {{-a + d, -b + e, -c + f}, {-d + g, -e + h, -f + i}} *)
share|improve this answer
Thanks @b.gatesucks I didn't know this function existed! – sebastian c. Jan 11 '13 at 13:06
@sebastian if you are grateful for answers you should be Accepting some of them too. You haven't done this for a very long time. Why not? – Mr.Wizard Jan 11 '13 at 13:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.