[visionegg] Re: Control visionegg from Matlab

  • From: Mark Halko <mhalko@xxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Wed, 26 Aug 2009 12:48:17 -0400

You could use something like mlabwrap, which should give you access to
matlab like you'd want.
http://mlabwrap.sourceforge.net/

If you're tied to using matlab, why not use matlab to do your stimulus
presentation?  (Psychophysics Toolbox?)

For the most part, you should be able to do almost everything with
numpy and scipy that you'd want to do with matlab (also, note that
python has matplotlib, which provides plotting functionality similar
to matlab).  Eventually, you'll want to make a choice - either
completely convert to python, or stick with matlab - there's no reason
to be spending time trying to maintain compatibility between both
environments.  My bet is that bugs will arise from the communication
between matlab and python that will make debugging difficult and time
consuming (probably longer than had you just made the switch to python
to begin with).

Mark

On Wed, Aug 26, 2009 at 11:51 AM, Andrew Straw<astraw@xxxxxxxxxxx> wrote:
> patrik andersson wrote:
>> Hi all,
>>
>> I have just started looking at how to use visionegg (I normally write
>> everything in Matlab).
>> Having played around a bit and liking what I see I have a couple of
>> questions that I would be really grateful if someone could help
>> answering before I make the decision to switch.
>> 1. I will still use Matlab for a lot of other stuff, and will need to
>> change the stimuli depending on what comes out from Matlab.
>>     Is it possible to control the visionegg application from Matlab?
>> 2. Will this control be fast?
>> 3. Is there any problems with Vista compatibility? (I hate Vista but
>> am stuck with it)
>>
> Hi Patrik,
>
> The easiest way to control the VE is to simply start a new process with
> the VE script you wish to run. In python, this would be something like:
>
> import subprocess
> subprocess.check_call('python my_cool_visionegg_script.py')
>
> I know this is possible in MATLAB, I just don't remember the function
> name required.
>
> As far as anything more elaborate, you've got two broad categories of
> options 1) getting Python to run in your same MATLAB process using some
> sort of embedding with mex files or 2) using inter-process communication
> (IPC) to control Python. Approach 2 is bound to be much simpler, and
> there are numerous ways you could do it. The specific approach, speed of
> implementation and speed of execution depend a lot on what exactly you
> need to do -- so if you can provide more details, I'm happy to give more
> specific suggestions. Apparently TCP/IP networking is not built into
> base MATLAB (a shocking omission and correct me if I'm wrong). To use
> TCP in MATLAB, one needs the Industrial Control Toolbox or to download a
> 3rd party free toolbox. Regardless of this, using TCP in some way would
> probably be near the top of my list.
>
> I don't know of any reason why Vista wouldn't be compatible, but I
> haven't tested the VE with it, either. My understanding is that most
> Python stuff works fine.
>
> -Andrew
>
> --
> Andrew D. Straw, Ph.D.
> California Institute of Technology
> http://www.its.caltech.edu/~astraw/
>
> ======================================
> The Vision Egg mailing list
> Archives: //www.freelists.org/archives/visionegg
> Website: http://www.visionegg.org/mailinglist.html
>
=====================================The Vision Egg mailing list
Archives: //www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html

Other related posts: