MATLAB: B = A(abs(diff(A))); i want to find the abs difference of 08 values

please help

08 values in a row i have to find the absolute differnce of these values any one help me like
A = [3,6,9,8,7,8,6,8]
B = A(abs(diff(A)));
THIS ERROR WILL BE SHOWN ubscript indices must either be real positive integers or logicals.
Error in CodeDriver (line 214) B = A(abs(diff(A)));

Best Answer

You've likely created variables named abs and/or diff. Rename those variables and you will be able to use the abs and diff functions again.
Related Question