How to create a circulant matrix column wise?

7 vues (au cours des 30 derniers jours)
ANJANA K P
ANJANA K P le 3 Nov 2020
Modifié(e) : KSSV le 3 Nov 2020
I want to create M x L circulant matrix column wise,where M=16 and L=20.

Réponse acceptée

Ameer Hamza
Ameer Hamza le 3 Nov 2020

Plus de réponses (2)

KSSV
KSSV le 3 Nov 2020
  2 commentaires
ANJANA K P
ANJANA K P le 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 le 3 Nov 2020
Modifié(e) : KSSV le 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

Connectez-vous pour commenter.


Bruno Luong
Bruno Luong le 3 Nov 2020
col = rand(16,1) % your 1-column vector
A = toeplitz(col,col(mod((1:20)-1,end)+1))

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by