How to create a circulant matrix column wise?

Weitere Antworten (2)

KSSV
KSSV am 3 Nov. 2020

0 Stimmen

2 Kommentare

ANJANA K P
ANJANA K P am 3 Nov. 2020
Thank you for the response.But I am again getting a square matrix .I need the result as M x L. ie,16*20 matrix as the answer.
Thanks in Advcance.
KSSV
KSSV am 3 Nov. 2020
Bearbeitet: KSSV am 3 Nov. 2020
Read about Circshift.
m = 16 ; n = 20 ;
r = rand(m,1) ;
iwant = zeros(m,n) ;
iwant(:,1) = r ;
for i = 2:n
iwant(:,i) = circshift(iwant(:,i-1),1) ;
end

Melden Sie sich an, um zu kommentieren.

Bruno Luong
Bruno Luong am 3 Nov. 2020

0 Stimmen

col = rand(16,1) % your 1-column vector
A = toeplitz(col,col(mod((1:20)-1,end)+1))

Kategorien

Mehr zu Elementary Math finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 3 Nov. 2020

Bearbeitet:

am 3 Nov. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by