Error: Unable to perform assignment because the left and right sides have a different number of elements.
1 回表示 (過去 30 日間)
古いコメントを表示
M = 64; %Number of subcarriers
K = 4; %Overlapping factor
y = [-0.23514695 -sqrt(2)/2 -0.97195983 1 0.97195983 sqrt(2)/2 0.23514695];
T = M;
l = K*T;
a = K*M;
t = -a/2:a/(2-1);
h = zeros(1,10000);
size(h);
for k = -3:3
for x=0:6
r = k+3;
abc=size((y(x+1)^2)*cos((2*k*pi*t)/l));
h(r+1)= (y(x+1)^2)*cos((2*k*pi*t)/l); Error here
end
end
h = [h{:}];
h = h(1)+h(2)+h(3)+h(4)+h(5)+h(6)+h(7);
a = 1+ (2*h);
figure(1)
plot (a)
xlabel('t')
ylabel('h(t)')
0 件のコメント
回答 (1 件)
dpb
2020 年 8 月 10 日
h(r+1)= (y(x+1)^2)*cos((2*k*pi*t)/l); Error here
Above, t was defined as
t = -a/2:a/(2-1);
and a = K*M ==> 4. 64 ==> 256
Hence
t=[-128:256];
which will have 384+1 = 385 elements. The index r+1 on the LHS is just one element in length.
Dunno what you want or intended, but that's the mismatch.
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!