matlab中screen函数,14 用 Screen 函数打开一个窗口

本文介绍了如何使用MATLAB结合Psychtoolbox打开屏幕窗口,并通过代码详细解释了每个步骤,包括设置、获取屏幕编号、颜色处理、窗口打开等操作。通过示例代码,展示了如何创建全屏灰色窗口,并等待用户按键结束程序。
摘要由CSDN通过智能技术生成

从今天开始,我打算边解释 PTB 自带的 demo 程序,边讲解一些涉及到的知识点,这样进度会快一点。

PTB 的 demo 可以在 Psychtoolbox Demos 网站上获取。另外,在安装目录的 PsychDemos 文件夹下也有大量的 demo 程序。

这次介绍下 Screen 的窗口操作。

在屏幕上显示一些内容,是我们用得最多的功能。要在屏幕上显示内容,需要先打开一个窗口。

Psychtoolbox Demos 网站上的第一个 demo 就演示了如何打开窗口,并获得一些其他信息。

% 第一块 Clear the workspace and the screen

sca;

close all;

clearvars;

% 第二块 Here we call some default settings for setting up Psychtoolbox

PsychDefaultSetup(2);

% 第三块 Get the screen numbers. This gives us a number for each of the screens

% attached to our computer.

screens = Screen('Screens');

% 第四块 To draw we select the maximum of these numbers. So in a situation where we

% have two screens attached to our monitor we will draw to the external

% screen.

screenNumber = max(screens);

% 第五

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值