What does toeplitz do in this code?
2 次查看(过去 30 天)
显示 更早的评论
hello.can anyone help me to understand this code about mimo correlated fading channel?i
will be forever greatful.
function hh=channel coeff(NR,NT,n,rtx,rrx,type)
h=sqrt(1/2)*(randn(nr*nt,n)+j*randn(nr*nt,n))
if nargin,hh=h; return,end
if isvector(rtx)=toeplitz(rtx);
if isvector(rrx),toeplitz(rrx);
if strcmp(type,'complex')
c=chol(kron(rtx,rrx));
else
c=sqrtm(sqrt(kron(rtx,rrx)));
end
hh=zeros(nr,nt,n);
for i=1:n
tmp=c*h(: ,);
hh(: , : , i)=reshape(nr*nt*n);
end
2 个评论
Guillaume
2019-4-8
if isvector(rtx)=toeplitz(rtx);
is not valid matlab syntax. The = is illegal there, and the if appears to be missing a matching end
if isvector(rrx),toeplitz(rrx);
is also missing a matching end. Otherwise the syntax is legal but since the result of toeplitz is not assigned to anything, the whole thing is pointless.
Perhaps the best person to ask about this code is the author.
I wouldn't recommend using unknown code that does not even have a single comment explaining what it does. That's not a very good mark of quality.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Propagation and Channel Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!