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

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Given a frequency, return the number of cents difference between the given frequency and its nearest semitone (in 12-tone equal temperament with A440) as well as the semitone it is closest to (in scientific pitch notation, using # for sharp and using natural pitches whenever possible) with A440 referring to A4. Refer to the wikipedia articles below for more information.

References:

11 correct solutions
20 incorrect solutions

Last solution submitted on Mar 20, 2015

4 Comments