|
"Diego Zegarra"
> ??? Error using ==> sub2ind at 58
> Out of range subscript.
> Error in ==> EF4SAPSLMETARAPS at 351
> EijF(sub2ind(size(EijF), Eij_CM(:,1:end-1), Eij_CM(:,2:end)))=...
> EijF(sub2ind(size(EijF), Eij_CM(:,1:end-1), Eij_CM(:,2:end))) + (1/S(s))/E_B;
>
> Sometimes it work and sometimes it shows this error. What does it mean...
as the error message clearly says: the inputs to SUB2IND cannot(!) give a valid result, in particular, if one looks at your vars
size(EijF)
Eij_CM(:,1:end-1) % one or more indices > size(...,1)
Eij_CM(:,2:end) % one or more indices > size(...,2)
since this does not happen regularly, you might consider doing this
% at the command prompt
dbstop if error
% run your function
% if an error occurrs, it will stop in the current function/ws
% now carefully inspect your vars
us
|