第六章 心理学工具箱讨论区(提问或回答均计分)

我的MATLAB无法查找FillRect函数

我的MATLAB无法查找FillRect函数

张卓群3227010050 -
回帖数:1

>> PsychtoolboxRoot  %返回 Psychtoolbox 安装的根目录路径

ans =

'D:\ruanjian\心理学工具箱ZIP下载版-64bit Matlab or Octave-Windows系统-20231218\Psychtoolbox-3-Psychtoolbox-3-9993c8f\Psychtoolbox\'

>> addpath('D:\ruanjian\心理学工具箱ZIP下载版-64bit Matlab or Octave-Windows系统-20231218\Psychtoolbox-3-Psychtoolbox-3-9993c8f\Psychtoolbox')  %添加 Psychtoolbox 到 MATLAB 的路径中

>> which FillRect  
未找到 'FillRect'。

>> help FillRect  %可以使用此命令来查找,但我的MATLAB无法查找

未找到 FillRect。

请使用帮助浏览器的搜索字段搜索文档,或者
键入 "help help" 获取有关帮助命令选项的信息,例如方法的帮助。

>> help Screen.FillRect   %可以使用此命令来查找,但我的MATLAB无法查找

未找到 Screen.FillRect。

请使用帮助浏览器的搜索字段搜索文档,或者
键入 "help help" 获取有关帮助命令选项的信息,例如方法的帮助

这是怎么回事呢?刚开始直接输help FillRect找不到,返回工具箱目录重新添加路径还是找不到

回复张卓群3227010050

回复: 我的MATLAB无法查找FillRect函数

孙芷菁3227010035 -
用Screen FillRect?

输出结果:
Usage:

Screen('FillRect', windowPtr [,color] [,rect] )

Fill "rect". "color" is the clut index (scalar or [r g b] triplet or [r g b a]
quadruple) that you want to poke into each pixel; default produces white with
the standard CLUT for this window's pixelSize. Default "rect" is entire window,
so you can use this function to clear the window. Please note that clearing the
entire window will set the background color of the window to the clear color,
ie., future Screen('Flip') commands will clear to the new background clear color
specified in Screen('FillRect').
Instead of filling one rectangle, you can also specify a list of multiple
rectangles to be filled - this is much faster when you need to draw many
rectangles per frame. To fill n rectangles, provide "rect" as a 4 rows by n
columns matrix, each column specifying one rectangle, e.g., rect(1,5)=left
border of 5th rectange, rect(2,5)=top border of 5th rectangle, rect(3,5)=right
border of 5th rectangle, rect(4,5)=bottom border of 5th rectangle. If the
rectangles should have different colors, then provide "color" as a 3 or 4 row by
n column matrix, the i'th column specifiying the color of the i'th rectangle.

See also: FrameRect