Introduction - If you have any usage issues, please Google them yourself
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 actual motor/rotor u must have a microcontroller that will get command matlab and will send the command to that particular pin on which ESC of motor is connected.