Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Create a new vector from a current vector
Date: Mon, 5 Nov 2007 15:04:45 +0000 (UTC)
Organization: University of Karlsruhe
Lines: 18
Message-ID: <fgnbec$21u$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1194275085 2110 172.30.248.35 (5 Nov 2007 15:04:45 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Nov 2007 15:04:45 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1159660
Xref: news.mathworks.com comp.soft-sys.matlab:436096




Hi MATLAB users,

Suppose we have a matrix or vector with only one column of 
length 20.

A=[1,3,3,4,2,4,3,5,5,2,4,3,7,4,2,4,1,4,2,3];

My question is that how to create a new matrix or vector 
from A so that the new vector be sums of every 4 values of 
A. Therefore the new vector of B will have a length of 5.

B=[11,14,14,17,10];

How to create B from A?

Thank you very much.
Amir