MATLAB: Undefined function ‘integer’ for input arguments of type ‘double’.

undefined function 'integer' for input arguments of type 'double'.

i have script
trdat=annrdat(1:id1);
ntr=length(trdat);
for i=1:4
a=(id2-(lidx(i))-ntr+1);
b=id2-(lidx(i));
tridx(:,i)=annidx(a:b,i);
clear a b
end
X=[ones(ntr,1) tridx(:,1) tridx(:,2) tridx(:,3)];
Y=trdat;
B=regress(Y,X);
Error: Subscript indices must either be real positive integers or logicals.

Best Answer

At the MATLAB command line give the command
dbstop if error
and run the code. When it stops, please show us the values of a and b and i. I suspect you will find that a and b are not positive integers.