MATLAB:Psychtoolbox安装

由于需要在Matlab上安装Psychtoolbox,我先去查找了一些相关的经验贴,然后按照如下操作进行安装的。

1.下载DownloadPsychtoolbox.m

这里我找到了Psychtoolbox的官方安装网址:http://psychtoolbox.org/download#download-problems
该网址中详细的列出了关于旧版本的处理,不同电脑的对应安装包,以及其他相应的安装文件,可以详细看看,此处列出目录部分

Contents
Removing Old Versions of Psychtoolbox
Installation Instructions
Linux
Windows
Mac
Alternate download as a zip file
Installation without Download
Staying Up-to-Date
More Information
Download problems
Subversion
Downgrading
Access to Archived Versions of PTB-3

(ps:我安装的是window版本,但是该网址中仅仅列出了安装在C盘的方法)
下载对应的Psychtoolbox.zip文件,然后打开matlab,运行第二步

2.运行命令

把路径切换到你保存DownloadPsychtoolbox.m文件的地方,在命令行里输入

>>DownloadPsychtoolbox('此处填写安装DownloadPsychtoolbox.m的路径')

运行后显示如下:

DownloadPsychtoolbox(‘E:\matlab’)
DownloadPsychtoolbox(‘E:\matlab’,‘beta’,’’, 0)
Requested flavor is: beta
Requested location for the Psychtoolbox folder is inside: E:\matlab
Using optimal client for subversion checkout.
Good. Your privileges suffice for the requested installation into folder E:\matlab.
I will now download the latest Psychtoolbox for Windows.
Requested flavor is: beta
Target folder for installation: E:\matlab
Downloading via Matlabs integrated SVNKit: This can take multiple minutes.
There may be no output to this window to indicate progress until the download is complete.
Please be patient …
Download of SVN revision 12166 succeeded!
Now adding the new Psychtoolbox folder (and all its subfolders) to your MATLAB / OCTAVE path.
Success.
Now setting permissions to allow everyone to write to the Psychtoolbox folder. This will allow future updates by every user on this machine without requiring administrator privileges.
Success.
You can now use your newly installed ‘beta’-flavor Psychtoolbox. Enjoy!
Whenever you want to upgrade your Psychtoolbox to the latest ‘beta’ version, just run the UpdatePsychtoolbox script.

出现enjoy表示安装成功,后续又显示了相关内容

Running post-install routine…
Creating a startup.m file for Psychtoolbox at E:\matlab\Psychtoolbox\PsychInitialize\startup.m
PsychStartup: Environment variable GSTREAMER_1_0_ROOT_MSVC_X86_64 is undefined.
PsychStartup: Either GStreamer-1.18 MSVC or a later version is not installed at all, or if it is installed, then
PsychStartup: something is botched. Trying various common locations for the GStreamer runtime to keep going.
PsychStartup: Path to GStreamer runtime is undefined! This probably means that
PsychStartup: the 64-Bit GStreamer 1.18+ MSVC runtime from www.gstreamer.net is not installed.
PsychStartup: The Psychtoolbox Screen() function will not work at all until you fix
PsychStartup: this! Read ‘help GStreamer’ for instructions.
Matlab release 2007a or later detected. Will prepend the following
folder to your Matlab path: E:\matlab\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\ …
*** Matlab’s Static Java classpath definition file modified. You will have to restart Matlab to enable use of the new Java components. ***
Press RETURN or ENTER to confirm you read and understood the above message.
A very simple test call to the Screen() MEX file failed in AssertOpenGL, indicating
that either Screen is totally dysfunctional, or you are trying to run your script on
a system without Psychtoolbox-3 properly installed - or not installed at all.
On Windows you must install the MSVC build runtime of at least GStreamer 1.18.0
or a later version. Screen() will not work with earlier versions, without GStreamer,
or with the MinGW variants of the GStreamer runtime!
Read ‘help GStreamer’ for more info.
Screen() does not work. Read all preceeding and following output as well as “help AssertOpenGL” for more info.
A first diagnostic test would be to simply type ‘Screen’ in your Matlab/Octave console and check what its output is.
The returned error message by Matlab/Octave was:
Last Error: MEX 文件 ‘E:\matlab\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\Screen.mexw64’ 无效: 找不到指定的模块。 (MATLAB:mex:ErrInvalidMEXFile)
E:\matlab\Psychtoolbox\PsychOneliners\AssertOpenGL.m,80
E:\matlab\Psychtoolbox\PsychtoolboxPostInstallRoutine.m,650
E:\matlab\DownloadPsychtoolbox.m,757
NOTE: You may want to acquire paid priority support for future issues like this.
Please type ‘PsychPaidSupportAndServices’ to learn more.
Screen() failed to work for some reason:
On Windows you must install the MSVC build runtime of at least GStreamer 1.18.0
or a later version. Screen() will not work with earlier versions, without GStreamer,
or with the MinGW variants of the GStreamer runtime!
Read ‘help GStreamer’ for more info.
Check the troubleshooting instructions on our Wiki (Download section
and FAQ section, maybe also the Bugs section).
Once you manage to fix the problem (simply type ‘AssertOpenGL’ to verify
that stuff works now), you do not need to run the installation routine again,
but can start working immediately.
Press RETURN or ENTER to confirm you read and understood the above message.

GENERAL LICENSING CONDITIONS AND TERMS OF USE:

Almost all of the material contained in the Psychtoolbox-3 distribution
is free-software and/or open-source software under a OSI (http://www.opensource.org/)
approved license. Most material is covered by the MIT license or a MIT compatible license.

A few internal libraries and components are covered by other free software
licenses which we understand to be compatible with the MIT license, e.g., the GNU LGPL
license, or BSD and Apache-2.0 licenses, or they are in the public domain.

3rd-party components which are freely useable and redistributable for non-commercial
research use, due to the authors permissions, but are not neccessarily free / open-source
software, can be found in the “PsychContributed” subfolder of the Psychtoolbox distribution,
accompanied by their respective licenses.

A few components are licensed under the GNU GPL v2 license with a special linking
exception for use with Mathworks proprietary Matlab application. A very few components,
e.g., the PsychCV() function are currently covered by the standard GPL v2 license and
cannot be used with Matlab. These are only available for use with GNU/Octave.

Please read the license text and copyright info in the Psychtoolbox file
License.txt carefully before you use or redistribute Psychtoolbox-3.
Use of Psychtoolbox-3 components implies that you have read, understood and accepted
the licensing conditions.

However, in a nutshell, if you just use Psychtoolbox for your research, our licenses
don’t restrict you in any practically relevant way. Commercial users, developers or
redistributors should make sure they understood the licenses for the components they use.
If in doubt, contact one of the Psychtoolbox developers, or the original authors of the
components you want to use, modify, merge or redistribute with other software.

Your standard Psychtoolbox distribution comes without the source code for
the binary plugins (the MEX files). If you want to access the corresponding
source code, please type “help UseTheSource” for specific download instructions.

BEGINNERS READ THIS:

If you are new to the Psychtoolbox, you might try this:
help Psychtoolbox

Psychtoolbox website, which also links to a tutorial for basic use cases:
web http://www.psychtoolbox.org -browser

Please make sure that you have a look at the detailed ECVP 2013 tutorial slides
in the PDF file PTBTutorial-ECVP2013.pdf
in the Psychtoolbox/PsychDocumentation subfolder for an overview of differences
between Psychtoolbox-2 and Psychtoolbox-3 and proper use of basic features. That
folder contains various additional helpful information for use of Psychtoolbox.

Please also familiarize yourself with the demos contained in the PsychDemos subfolder
and its subfolders. They show best practices for many common tasks and are generally
well documented.

IMPORTANT NEWS:

You can now financially contribute to Psychtoolbox sustainability, upkeep and continued
improvement by buying a community membership, which also includes some priority support
for questions regarding its use, or issues you may have with it. We also offer paid
feature development and other useful commercial services.
Please type ‘PsychPaidSupportAndServices’ to learn more.
Enjoy!
Press RETURN or ENTER to confirm you read and understood the above message.

3.测试

在命令行中键入Screen进行测试,但是出现了如下问题:

>> Screen
MEX 文件 'E:\matlab\Psychtoolbox\PsychBasic\MatlabWindowsFilesR2007a\Screen.mexw64' 无效: 找不到指定的模块。

经过查询是由于gstreamer的安装的出现不匹配或者未安装,为了避免踩坑
可以现在matlab中查询对应的gstreamer版本,在matlab命令行中按如下操作:


>>help GStreame

由于我未安装,所以出现如下提示:
在这里插入图片描述
后续提示了安装网址:
在这里插入图片描述
此处我只截取了window的安装网址,第二个网址为与matlab适配的安装网址,下载安装对应版本。
安装完成后出现:

PsychStartup: Adding path of installed GStreamer runtime to library path. [F:\gstreamer\1.0\msvc_x86_64\bin]

这表明GStreamer成功定位允许你正常使用它的功能。
再重新测试Screen:
在这里插入图片描述
成功啦!

嘿嘿,希望能帮助到大家!!!

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值