The algorithm is applicable for all kind of rotors using BLDC motors and ESC (obviously).
Particularly this program is applicable only with arduino board with the serial communication ready.
You can change the initial statements if u dont have arduino development board.
Where as to calculate from actual motor/rotor u must have a microcontroller that will get command from matlab and will send the command to that particular pin on which ESC of motor is connected. note that pin must be a PWM capable.
Ask if any queations