Code examples in Matlab for the simulation and visualization of behavioral data.
Other examples of visualization of live behavior can be found in:
- Model-based and Model-free RL solving a sequential two-choice Markov decision task
- ON and OFF policy solutions for the “windy grid-world task”
- ON and OFF policy solutions for the cliff task
Of course it is not necessary to visualize the behavior of the artificial agents to mathematically describe the computations required to solve a task, but it is helpful to see the behavior to understand how this is shaped by rewards and punishments in the environment.

This work by Vincenzo Fiore is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Virtual fly test tube
In an ongoing collaboration with dr Frank Hirth’s lab, a couple of months ago I have been invited to generate the code for a simulated insect navigating a virtual 2-dimensional world. This investigation aimed at testing whether a recently developed neural model of the central complex in insects (i.e. see…
Randomly sampled TTest comparison
The following code has been used to compare couples of vectors in a given structure composed of 4×12 cells which result from simulated results of 4×12 model genotypes (download archive here). Most vectors have a similar dimension (175), but some differ, requiring a multiple random comparison by permutation. The final distribution of…
Continuous error band in Matlab
I was looking for a plot function in Matlab that could create error “bands” with a continuous filled plot for the standard error, highlighting the mean. In the end I decided to create the function I needed so that I could have the parameters I wanted: namely colours and transparency. Here…