How to create a circulant matrix column wise?

8 次查看(过去 30 天)
I want to create M x L circulant matrix column wise,where M=16 and L=20.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-11-3

更多回答(2 个)

KSSV
KSSV 2020-11-3
  2 个评论
ANJANA K P
ANJANA K P 2020-11-3
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 2020-11-3
编辑:KSSV 2020-11-3
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

请先登录,再进行评论。


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

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by