I understand the power of Matlab in data analysis, but I want to know if Matlab can also be used to control Med Associates boxes in a behavioral experiment.
For analysis, Matlab is one of the best Software. Coming to control, we have a very best research platform for Data Acquisition and Control which is LabVIEW. By using this along with compatible Interfacing Modules, we can control any type of Instruments and Measure any kind of parameters using Instruments for further analysis.
Try to read about the TTL pulse via matlab. If possible it can be used to send a on/off pulse that can be used with relay to control virtually anything.
Why do you want to use Matlab to control the behavioral boxes when you can simply edit the Med Associates source code and save it as a new file? We do this all the time to control the number of lever presses and lights et cetera used in our operant experiments.
To answer your question, I need to know the following. Do you have Med-Assoc control equipment, the DIG controllers, or just the operant boxes? Do you have any software from Med-Assoc.?
You need to identify the specific input and output port for this to work. It used to be easy with the old MED-PC documentation, but current documentation does not discuss that. A limitation with MATLAB, I think, is that you probably can only control one chamber with each computer, unless you get into a very complicated code in which you are polling each response for each chamber every few ms as well as seeing if time events have passed. If you have more than one chamber controlled by one computer, I think it will be much easier to learn Med-PC IV than to try to use MATLAB. Also, as I recall MATLAB is not compiled so the first time you call a function it is leaded from memory, taking time. You can end up with some serious timing issues. I've used MATLAB with Psychtoolbox to control operant chambers with touch screens. I was doing nothing very time sensitive, but timing was a bit of an issue.
If you decide to use MED-PC you can contact me directly and I may be able to help.
I think you may wish to obtain their (Med Associates') API to make life easier. That said, there are options available to communicate with the DIG-704 driver in different programming languages. Please take a look at the attached document (from their website) for more information.
Jim is right. You'd lose the ability to run a number of boxes simultaneously, and you'd likely get timing problems. The only reason that you might want to use MatLab might be to arrange very complex feedback functions, but even that can be done with TurboPascal code in MED-PC. And don't try to program directly in TurboPascal -- I did that once and ended up with 3-4 meters of code, which could have been done with 30 lines of MED-PC.