Info
此问题已关闭。 请重新打开它进行编辑或回答。
why do i receive the error "Subscript indices must either be real positive integers or logicals" ?
1 次查看(过去 30 天)
显示 更早的评论
Hi
im trying to write down a code that calculate MMSE equalization coefficients , in this code K is the number of coefficients which gives 15 coefficients. all the time i run my m-file it replies "Subscript indices must either be real positive integers or logicals" and i dont no what to do about it . it appears that it need to add some part to it of course C matrix would be calculated later one , as i checked j loop stuck in -1 but still dont get it , could anyone suggest any idea ??? , here is my code :
clc
clear all
close all
a=[0.227 0.46 0.688 0.46 0.227];
aa=fft(a,100);
f=abs(aa);
f1=f/max(f);
f2=20*log10(f1);
k=7;
n0=0;
l=length(a);
x=conv(f,conj(f));
for i=-k:k
for j=-k:k
Gamma(i+k+1,j+k+1) = x(i-j+l+1);
end
end
2 个评论
Walter Roberson
2017-6-25
Why? Because your l = 5, and when i = -7 and j = -1, i-j+l+1 is -7-(-1)+5+1 = 0
Note: you should also be checking whether you should be using
x = conv(f, conj(f), 'same');
which you would use if you expect x to be the same size as f
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!