|
From: | Markus Appel |
Subject: | Re: Gallery (or circulant matrices) |
Date: | Sat, 08 Jun 2013 03:11:06 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
On 06/08/2013 02:26 AM, Jeffrey wrote:
Converting from Matlab, the "gallery" command to create circulant matrices is not implemented. Is there an Octave equivalent to K=gallery('circul',[4 -1 zeros(1,N-3) -1]); How does one find octave equivalents to Matlab statements? Thanks.
I can't answer the general question of how to find equivalents, but in the special case of this matrix (and if i understood the 'circul' gallery function right) you should be able to substitute
K=gallery('circul',v) by K = v( 1 + mod( (1:length(v))' - (1:length(v)), length(v)) )The expression is basically creating an index matrix with shifted columns and picking the elements out of your input vector v in the right order.
Hope it helps, Markus
[Prev in Thread] | Current Thread | [Next in Thread] |