Why does ind2sub not return integer output when the datatype of the second argument is single?
For example,
>> format long >> A = rand(5860,5091); >> [i, j] = ind2sub(size(A), single(16779030)); >> i i = 1849 >> j j = 2.864000244140625e+03 >> A(i,j) Subscript indices must either be real positive integers or logicals.
Best Answer