Using Arduino with Matlab and Simulink to build a controller?

I have no experiance with Matiab or Simulink, however assuming that they can communicate via USB serial then it should be possible. The tricky part is that an Arduino does not have a true analog output function. The analogWrite() command generates a PWM TTL voltage level square wave signal the varies it's duty cycle from 0-100%. You have to wire the pwm output pin to a low pass filter (a simple series resistor followed with a capacitor to ground. The junction of the resistor and cap will then show a true analog voltage of 0-5vdc. This could then be wired back to a analog input pin and it's value sent back out via USB serial link to your PC.

However this would seem redundant unless you were actually using the true analog output voltage to control something physical. Otherwise just send the PWM value signal used inside the program, with proper scaling and send it back to your PC ?

That make sense?

Lefty