フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

why do i receive the error "Subscript indices must either be real positive integers or logicals" ?

1 回表示 (過去 30 日間)
HamidReza Saleh
HamidReza Saleh 2017 年 6 月 25 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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
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
HamidReza Saleh
HamidReza Saleh 2017 年 6 月 25 日
x = conv(f, conj(f), 'same');
it didnt change anything , it appears that i need to define an "if" BUT where and how dont know i guess i consider -14 as 1

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by