How can I communicate from Arduino to MATLAB I want to use sensors on an Arduino to control values in a MATLAB program. What are my options for communicating?

I've used Processing to receive data sent via the serial cable, and that strategy has worked pretty well. Is there something similar I can do using MATLAB? I'm somewhat new to MATLAB, so gentle guidance would be great.

I'm not really looking for something like the ArduinoIO package -- I want to have separate computation executing on the Arduino and occasionally informing my MATLAB program (which will occasionally poll the serial line, I suppose).
MATLAB Support Package for Arduino (aka ArduinoIO Package) allows you to do it fairly easily.


  Sample usage:
  
  %-- connect to the board 
  
  a = arduino('COM9')
  
  %-- specify pin mode 
  
  a.pinMode(4,'input');
  
  a.pinMode(13,'output');
  
  %-- digital i/o 
  
  a.digitalRead(4) % read pin 4
  
  a.digitalWrite(13,0) % write 0 to pin 13
  
  %-- analog i/o 
  
  a.analogRead(5) % read analog pin 5
  
  a.analogWrite(9, 155) % write 155 to analog pin 9