GithubHelp home page GithubHelp logo

huelemeier / test-screen-resolution Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 28 KB

Receive information about screen resolution and refresh rate.

MATLAB 100.00%
matlab psychtoolbox refresh-rate screen-resolution

test-screen-resolution's Introduction

Test screen resolution of your Psychtoolbox window

The purpose of this script is to test the screen resolution and refresh rate of your Psychtoolbox window. When running experiments with externally connected screens, it can be useful to check the technical set-up. For instance, if you run create a world using OpenGL and you want to interact with the world by marking a spot using Psychtoolbox directly, you must make sure the aspect ratio of your OpenGL world (always 4:3 ratio) and your Psychtoolbox window harmonize. Sometimes, the pc detects the wrong aspect ratio of your externally connected screen.

Technical requirements and set-up

These scripts are optimized for MatLab 2021b with Psychtoolbox (http://psychtoolbox.org/download.html) with OpenGL add-ons. So what needs to be installed on you computer are Matlab and Psychtoolbox.

Set-up

Download the file and add it to your Matlab folder.

Explanation of the scripts

  • testresolution.m: this script measures the resolution, refresh rate and frames per second

Run the script

Type into your command window 'testresolution' and press the enter buttom. Psychtoolbox automatically opens a window and runs the script in that window. You will see information about window's height, width, refresh rate, and frames per second.

window

By clicking either the left or the right buttom of your computer mouse, you terminate the script and the Psychotoolbox window closes. Matlab's command window will provide information whether you pressed the left or right buttom. The pressed buttom is coded by the number 1. matlab

Change the size of the on screen window

By the way, you can change the size of the window. Open the script of the function to change the window size. The following line opens an on screen window of full size:

[win, winRect] = PsychImaging('OpenWindow', screenid, 0, [], [], [], stereoMode, multiSample); 

If you want a smaller window just change the code like this. You can type in any resolution you want:

[win, winRect] = PsychImaging('OpenWindow', screenid, 0, [0 0 800 600], [], [], stereoMode, multiSample); 

Either click on 'run' or type 'testresolution' into the command window.

test-screen-resolution's People

Contributors

huelemeier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.