MATLAB Answers

0

please check the following code in shown the error

Asked by VISHALI V on 9 Mar 2018
Latest activity Answered by Roger Stafford on 9 Mar 2018
clc;
clear all;
close all;
K=5;
M=100:100:1000;
q=10;
s = 0 + q.*randn(K,1);
v = s/10;
si=10.^v;
d=randi([10 50],K,1);
u=1;
a=2.0;
z=(d.^a);
%flat fading channel matrix
for k=1:K
b(k)=(1*si(k))/z(k);
end
D=diag(sqrt(b));
for t=1:10
H(t) = rand(M(t),K) + i*rand(M(t),K);
end
for y=1:10
G(y)=H(y) * D
end

  0 Comments

Sign in to comment.

1 Answer

Answer by Roger Stafford on 9 Mar 2018

It looks to me as though the line
H(t) = rand(M(t),K) + i*rand(M(t),K);
is in error. On the first trip through that for-loop, you are trying to stuff a 100 x 5 matrix into what appears to be a scalar location in vector H. How do you expect it to fit? Better think that step over again more carefully.

  0 Comments

Sign in to comment.