For electrical current stimulation, we use a Digitimer Constant Current Stimulator, model DS7A. It can be used at 3T, 7T, as well as the mock scanner.
Most important specifications:
If you'd like to drive the stimulator with Matlab, make sure you initialise access to the driver with io64. Then assign the right address: address = hex2dec('AFE8'); %check address device manager, ports (COM &LP), LPT1 resources 1st entry io range and flip the bits, for example like this:
byte = 0;
outp(address,byte);
byte = 255;
outp(address,byte);
Here you can find an example script.