absolute value of negative real numbers

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

 Accepted Answer

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

More Answers (1)

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 17 Oct 2017

Answered:

on 17 Oct 2017

Community Treasure Hunt

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

Start Hunting!