index must be positive integer or logical

1 vue (au cours des 30 derniers jours)
FAZLI  HADI
FAZLI HADI le 9 Oct 2018
Modifié(e) : KSSV le 9 Oct 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);

Réponse acceptée

KSSV
KSSV le 9 Oct 2018
Modifié(e) : KSSV le 9 Oct 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.

Plus de réponses (0)

Catégories

En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by