Getting started / Making an experiment

Experiment results output, Record properties

Results table and matrix, .mat and .csv files

When you run an experiment with the command runExperiment it outputs results in two variables. The first is a cell array that is meant to be easy to read in MATLAB’s visual variable editor. You can double-click it in the MATLAB workspace to open it there. The second compresses trial results into a numeric matrix or other arrays with uniform data types, which lets you extract and analyze in MATLAB without needing to convert from cell. Optionally runExperiment also saves results to both a .mat and .csv file at the end of each trial.

Specifying what to see in results – report, info

Just about everything in results comes from objects in the experiment. For any object you can specify what to see using two properties that all objects have: report and info. Both are optional—if you leave both at default, the object won’t show in results.

Property values – report

report is an array of strings that are names of properties to see for the object. These can include input properties which you can set when making the experiment. More commonly they include record properties, which you can’t set but PsychBench uses to record information during the experiment. Common record properties to report are response, responseLatency, and others for response handler elements. The documentation for each object type lists both its input and record properties.

Custom information – info

info sets custom information to see for the object—for example, test condition values that are not encapsulated in a convenient form in input properties. You can set info to a struct with any fields containing any values you want. Field names go to headings in the results table and field values go under those headings. (Tip: if you have values for a trial that are not specific to one element object, you can add a trial object and set info there as well.)

Example

Suppose each trial has a picture element in variable pic and a keyPress element in variable recorder. For pictures we want to see input property rotation as well as custom information under headings direction and d. For keyPresses we want to see record properties response, responseScore, responseLatency. Below are table columns setting results output properties to get this (other columns not shown).

The results table would look like this (first seven trials only). PsychBench automatically adds some information including results file name, date/time, screen measurements used for visual angle degree units, and trial numbers and start times. The rest comes from report and info properties.