필터 지우기
필터 지우기

Pls help me generate circulant matrix

조회 수: 2 (최근 30일)
Janet
Janet 2012년 3월 6일
편집: Emmanuel Ijiga 2016년 10월 2일
I want to create M x M circulant matrix where M=128
h1=gallery('circul',M:M/2);
h2=gallery('circul',M:M/2);
h=horzcat(h1,h2);
But I get error with this coding.
pls see this link for more info
in page 2 (2.2 mimo-ofdm sytem)

채택된 답변

Honglei Chen
Honglei Chen 2012년 3월 6일
You may want to use
M:-1:M/2
in your code, or something like that.
M:M/2
returns an empty vector so there is nothing to construct from it.
BTW, you can also use linspace. Say you want 5 points between M and M/2, just do
linspace(M,M/2,5)
  댓글 수: 1
Jan
Jan 2012년 3월 6일
@melody: You do not have to create two equal matrices to join them. h = [h1, h1] is ok.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Emmanuel Ijiga
Emmanuel Ijiga 2016년 10월 2일
편집: Emmanuel Ijiga 2016년 10월 2일
M = 20;
input = randi([0 15], 1, M); %Random Input values between 0 and 15
CM = zeros(M,M); %Initialize M X M Circulant Matrix (CM)
CM(1,:) = input; %place the input values in the first row of CM
for kk = 1:(size(CM,1) - 1)
CM(kk+1,1) = CM(kk,end);
CM(kk+1,2:end) = CM([kk],[1:end - 1])
end

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by