MATLAB: Absolute value of negative real numbers

abssubscript indice error

why negative real numbers are not allowed for "abs"? for example abs(-1) gives me 'Subscript indices must either be real positive integers or logicals' error

Best Answer

Probably you've created a variable called abs in the workspace. Try
clear abs
abs(-1)