index must be positive integer or logical

2 次查看(过去 30 天)
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);

采纳的回答

KSSV
KSSV 2018-10-9
编辑:KSSV 2018-10-9
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Operators and Elementary Operations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by