MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

FW: RE: matrix operations

  • To: mathgroup at
  • Subject: [mg46383] FW: [mg46343] RE: [mg46329] matrix operations
  • From: "E. Martin-Serrano \(Houston\)" <eMartinSerrano at>
  • Date: Mon, 16 Feb 2004 23:42:16 -0500 (EST)
  • Sender: owner-wri-mathgroup at


I have put this David's response in a notebook called "The wonders of
functional programming (by David Park).nb", mainly, because of the use he
does of "%". Notice the "spaces" and "parenthesis" in the file's name, and
its length as a string.

Spaces and length in Mathematica file names is something that has always
worried me:

My question is: while this file name is instructive, for the purpose of
maintaining a library and documentation. Which are the implications from the
side of the capability of Mathematica in handling package names, and such
strings of characters as symbols?

E. Martin-Serrano

-----Original Message-----
From: David Park [mailto:djmp at]
To: mathgroup at
Subject: [mg46383] [mg46343] RE: [mg46329] matrix operations


The wonders of functional programming! Here's an example.

mat = Array[x, {4, 4}]

Partition[mat, 2, 1]
(answer = #2 - #1 & @@@ %) // MatrixForm

@@@ is the Apply function, mapped onto the first level of mat. #2 - #1& is a
pure function that subtracts the second argument from the first argument.

David Park
djmp at

-----Original Message-----
From: paolo tarpanelli [mailto:tarpanelli at]
To: mathgroup at
Subject: [mg46383] [mg46343] [mg46329] matrix operations

If I have a matrix


how can I compute the difference between any element and the previous for
each column :

aa={x[[2,1]]-x[[1,1]], x[[2,2]]-x[[1,2]],...,x[[2,n]]-x[[1,n]]}
      {x[[3,1]]-x[[2,1]], x[[3,2]]-x[[2,2]],...,x[[3,n]]-x[[2,n]]}


I built this code but it does not work





  • Prev by Date: Re: Streaming input (with Linux)
  • Next by Date: Re: queation exporting quaternions from mathematica 5
  • Previous by thread: RE: matrix operations
  • Next by thread: Re: matrix operations