Calling matlab functions/ running matlab scripts from psychopy

195 views
Skip to first unread message

Jonathan O'Keeffe

unread,
Sep 21, 2012, 10:17:37 AM9/21/12
to psychop...@googlegroups.com

Hi,
    I am using the Basel Face Model to generate faces in matlab. I would like to generate faces according to the preferences of the subject during my psychopy experiment. I have written a script in matlab that will generate new faces and save them to disk.

So I am wondering what the best way to get a matlab script to run and then retrieve the newly generate files while in psychopy is.

Can anyone suggest anything?

Thanks, Jonathan

Jeremy Gray

unread,
Sep 21, 2012, 10:45:15 AM9/21/12
to psychop...@googlegroups.com
Hi Jonathan

if you can call your matlab script from a command line, you can do
this from psychopy:

from psychopy import core
cmd = "<your command-line matlab call here with arguments>"
out, err = core.shellCall(cmd, stderr=True) # returns stdout and stderr

simple pipes are fine on mac and *nix, not tested on windows. the
documentation is a bit sparse, http://www.psychopy.org/api/core.html,
so you might need to play around to see what works.

--Jeremy
> --
> You received this message because you are subscribed to the Google Groups
> "psychopy-users" group.
> To post to this group, send email to psychop...@googlegroups.com.
> To unsubscribe from this group, send email to
> psychopy-user...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/psychopy-users/-/Bi5De5qTeY0J.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
Reply all
Reply to author
Forward
0 new messages