index must be positive integer or logical

2 Ansichten (letzte 30 Tage)
FAZLI  HADI
FAZLI HADI am 9 Okt. 2018
Bearbeitet: KSSV am 9 Okt. 2018
I am getting the above mention error while running my code. Help me how to fix this. for your information "length of tua=61" or tua= -15:0.5:15
Attempted to access T(61,0); index must be a positive integer or logical.
Error in phatLoc (line 17) T(length(tau),end) = 0;
Error in messl>initIpd (line 276) tauPosInit = phatLoc(lr, tau, I, 0, vis);
Error in messl (line 126) [ipdParams itds] = initIpd(I, W, Nrep, tau, sr, lr, tauPosInit, pTauIInit, ...
Error in Main (line 68) [m,p] = messl(lr, tau, 2, 'vis', 1);

Akzeptierte Antwort

KSSV
KSSV am 9 Okt. 2018
Bearbeitet: KSSV am 9 Okt. 2018
Note that...MATLAB indices are always positive integers.......the indices start from 1....you are trying to access a index with 0..this is not correct.
A = rand(10,1) ;
A1 = A(1) % this gives first element
A1 = A(0) % this is wrong..throws error.

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by