From: Edmund on
Dear Matlab users,

I have a program in Matlab .m format which consists of selecting USB port, open port, read input from user (height), calculate servo angle, send printf(...) output from port to servo controller. This program works correctly.

I also have a simulink model which consists of an image processing (camera which reads the position of a ball).

My problem is, I want to connect the .m file with the simulink model since I am building a controller where the camera part (simulink) is the feedback and the servo controller position is the part where user inputs value and calculates the angle (output).

Right now I am trying to connect the closed loop of the system, and this involves the input from the user (which is found in the .m file), an error state (+ -) that goes to the calculation of the servo motor position(.m file) and then output to the plant(real system, com port). Now I have the feedback that is the camera part (simulink model .mdl) and I want to connect every part together but I am not sure how since parts are .m files and parts are .mdl.

Thanks any help would be greatly appreciated :).

Edmund.