MATLAB: ‘double’ input argument not found using a function

doublefindpeaksint16

Hello,
I have got a int16 array (called allAudio) and would like to run the function 'findpeaks' on it. When I write pks = findpeaks(allAudio(1,:)), the error message says: "Error using findpeaks (line 59) Input arguments must be 'double'."
I don't understand it... Any thoughts?

Best Answer

findpeaks only operates on numbers that are 64 bit floating point numbers (they're called doubles).
Convert your 16bit integers to double with the function "double".
double_allAudio = double(allAudio);