index must be positive integer or logical

2 visualizaciones (últimos 30 días)
FAZLI  HADI
FAZLI HADI el 9 de Oct. de 2018
Editada: KSSV el 9 de Oct. de 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);

Respuesta aceptada

KSSV
KSSV el 9 de Oct. de 2018
Editada: KSSV el 9 de Oct. de 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.

Más respuestas (0)

Categorías

Más información sobre Operators and Elementary Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by