circulant

バージョン 2.2.0.0 (2.21 KB) 作成者: Jos (10584)
(yet another, but fast) Circulent Matrix
ダウンロード: 2.5K
更新 2019/2/12

ライセンスの表示

C = circulant(V) or circulant(V, 1) returns the circulant matrix C
based on the row/column vector V. C is a square matrix in which each
row/column is a formed by circularly shifting the preceeding row/column
forward by one element. The first row (or column) is equal to V.

C = circulant(V, -1) applies a backward shift, returning a symmetric
matrix, so that C equals TRANSPOSE(C). In this case, it does not matter
if V is a row or column vector.

Examples:
circulant([2 3 5]) % forward shift
% -> 2 3 5
% 5 2 3
% 3 5 2

circulant([2 3 5].') % column input
% -> 2 5 3
% 3 2 5
% 5 3 2

circulant([2 3 5], -1), circulant([2 ; 3 ; 5], -1) % backward shift
% for both row or column vectors, this returns a symmetric matrix:
% -> 2 3 5
% 3 5 2
% 5 2 3

The output has the same type as the input.

V = {'One' '2' 'III'}
circulant(A)
% -> 'One' '2' 'III'
% 'III' 'One' '2'
% '2' 'III' 'One'

Notes:
- This version is completely based on indexing and does not use loops,
repmat, hankel, toeplitz or bsxfun. It should therefore run pretty
fast on most Matlab versions.
- See http://en.wikipedia.org/wiki/Circulant_matrix for more info on
circulant matrices.

See also toeplitz, hankel
latsq, ballatsq (on the file Exchange)

引用

Jos (10584) (2024). circulant (https://www.mathworks.com/matlabcentral/fileexchange/22876-circulant), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2018b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCreating and Concatenating Matrices についてさらに検索
謝辞

ヒントを得たファイル: Circular Matrix computation, Circulant matrix

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
バージョン 公開済み リリース ノート
2.2.0.0

modernised

1.3.0.0

Multiple acknowledgements added

1.2.0.0

v2.0 - bug fixed for forward shifted vectors !!

1.1.0.0

acknowledge both FEX ID 22814 and 22858

1.0.0.0