MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Joachim
on 22 May 2013

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?

*No products are associated with this question.*

Answer by Iain
on 22 May 2013

Accepted 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);

## 0 Comments