lqr controller with matlab

I used matlab programming to create a lqr controller for a robotic arm now I want to match this code with arduino I know that matlab and arduino could be match to gether with a plug in for matlab , but my question is how I could use this lqr code to the robotic arm(which has 3DOF) ? the matlab lqr code is for create a path for the robotic arm which there are desire angels for 3 dc motors