Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: add column matrix to each element of each diagonal in square matrix
Date: Sun, 20 Nov 2011 18:39:11 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <jabhge$40c$1@newscl01ah.mathworks.com>
References: <jaad0q$78b$1@newscl01ah.mathworks.com> <jabdfj$k16$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1321814351 4108 172.30.248.48 (20 Nov 2011 18:39:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 20 Nov 2011 18:39:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:749903

"Matt J" wrote in message <jabdfj$k16$1@newscl01ah.mathworks.com>...
> Z=flipud(toeplitz(E(end:-1:1)));
>  B=A+Z(1:m,1:m);
- - - - - - - - - -
  Also you can use the 'hankel' function and avoid doing the flip:

 B = A + hankel(E(1:m),E(m:2*m-1));

Roger Stafford