profiler

 elements

Runs the MATLAB code execution time profiler when the element is running, or optionally for the whole trial including pre- and post-trial intervals. This can be a useful debugging or assessment tool for all code running during this time, including other element type code. You can set MATLAB profiler options directly using the profile command before running the experiment.

The element writes profile results in a <cd>profile(<cd><cds>'info'<cds><cd>)<cd> struct to a .mat file after the trial. If the experiment halts on error, the element still writes profile results to the file up to that point. If the file already contains profile results, the element will append to them in a struct array, so you can use the same file for multiple profiler elements across trials in an experiment. If the file already exists at experiment start, it will be overwritten.

At least as of R2021a, you can input a saved profile info struct to the command profview to view it—type help profview at the MATLAB command line for usage but e.g. <cd>profview(0, <cd><infoStruct><cd>)<cd>.

For any trial you define in an experiment script, you can make one or more 

profiler

 objects using function 

profiler

Object and input them to addTrial.

For any trial you define in an experiment script, you can make one or more 

profiler

 objects using function 

profiler

Object and input them to addTrial.

Input properties

Adjustable properties

You can allow the subject to adjust the following input properties of an object of this type during the experiment using an adjuster element. If you need to make other properties adjustable, you can copy the element type using newPbType and edit it.

position
nn_eyes
rotation
opacity

(None)

(None)

profileWholeTrial

Default: profile code when the element is running

<cd>true<cd>/<cd>false<cd>: Profile code from the pre-trial interval through to the post-trial interval. Default <cd>false<cd> = only profile when the element is running. If = <cd>true<cd>, the element must still run in the trial to work but it actually doesn't matter when, and it will end on its own, so you don't need to set property end.

fileName

Default: profilerResults.mat

Name of .mat file to save or append results to. You can optionally include path. If you don't, it saves in the MATLAB current folder.

Input properties all visual elements have

position

Input properties all adjuster elements have

adjust

Input properties all objects have

report
info

Record properties

PsychBench uses record properties to record information during experiments. You can't set record properties but you can see them in experiment results using input property report.