Path: news.mathworks.com!not-for-mail
From: "Ulrik Nash" <uwn@sam.sdu.dk>
Newsgroups: comp.soft-sys.matlab
Subject: Creating a vector from differences in another vector
Date: Mon, 23 Nov 2009 11:34:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <hedrvc$kqb$1@fred.mathworks.com>
Reply-To: "Ulrik Nash" <uwn@sam.sdu.dk>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1258976044 21323 172.30.248.37 (23 Nov 2009 11:34:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 23 Nov 2009 11:34:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: news.mathworks.com comp.soft-sys.matlab:587152

Hi,

Suppose I have a vector A = [0 1 2 3 4 5]

now I wish to create another vector B from A 

where B = [0-1 1-2 2-3 3-4 4-5]

How would I do that using MatLab?

Regards,

Ulrik.