Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Getting values in between the values of a vector?
Date: Sun, 19 Apr 2009 18:06:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <gsfp69$19b$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1240164361 1323 172.30.248.37 (19 Apr 2009 18:06:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 19 Apr 2009 18:06:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1808180
Xref: news.mathworks.com comp.soft-sys.matlab:533884


Say I have a vector that's like this:

[-6 -3 0 3 6]

How can I get it get the number in between each of the two values to return something like:

[-4.5 -1.5 1.5 4.5]

Is there a built-in function that can do this? I'm asking because I'd like to avoid a loop if possible (but I'm thinking it's the only way). Thanks!