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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.