This repository contains MATLAB code used to simulate and analyse temporal feasibility constraints on wingbeat-call coordination in echolocating bats.
This code supports the following manuscripts:
- Biosonar Responsivity Sets the Stage for the Terminal Buzz
- Temporal Feasibility Constraints on Wingbeat-Call Synchrony in Actively Echolocating Bats
- Probabilistic Sensory Constraints Shape Swarm Cohesion in Echolocating Bats
- Adds all subfolders under
repo/to the MATLAB path.
wingbeat_sim_loop.m- Runs three deterministic scenario simulations:
- fixed wingbeat frequency, fixed excursion
- dynamic wingbeat frequency, fixed excursion
- dynamic wingbeat frequency, dynamic excursion
- Exports synchrony and waveform figures (PDF).
- Runs three deterministic scenario simulations:
sim_rand_var_run.m- Runs Monte Carlo simulations with randomised parameter sampling.
- Produces a
resultstable and savessimulation_results.mat.
analyse_sim_results.m- Loads and analyses simulation output.
- Computes descriptive summaries, effect sizes, and circular statistics.
- Exports summary CSV files and analysis figures.
- Core simulation and plotting helpers called by scripts in
mat/. - Includes
simulateEcholocationWings.m,generateVirtualBatCall.m, and formatting helpers (formatLatex*.m).
- Input and derived data files used by the analysis pipeline.
- Includes
simulation_results.matand exported summary CSVs.
- Output artefacts from simulation and analysis runs.
- Supplementary documentation and LaTeX assets.
citation.cff: citation metadata.LICENSE.md: repository licence.
- MATLAB R2020b or newer.
From MATLAB, with the working directory set to repo/:
initThen run scripts in this order:
- Deterministic scenario figures:
run('mat/wingbeat_sim_loop.m')- Monte Carlo simulations:
run('mat/sim_rand_var_run.m')- Analysis of Monte Carlo outputs:
run('mat/analyse_sim_results.m')Notes:
sim_rand_var_run.mwritessimulation_results.matin the current working directory.analyse_sim_results.mexpects../data/simulation_results.matby default whenresultsis not already in workspace. Update the path in the script if your output location differs.- Some scripts currently contain absolute output paths for figure export; adjust those paths for your local setup.
- Monte Carlo runs use random sampling (
rng('shuffle')insim_rand_var_run.m), so outputs differ between runs unless you set a fixed RNG seed. - Analysis outputs are exported as CSV tables for direct manuscript reporting and cross-checking.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).
You are free to share and adapt the material for non-commercial use with appropriate credit.
If you use this codebase in part or in full, please cite the corresponding manuscripts or contact the author for further information.
Check my ResearchGate or ORCID for a full list of my research work.
Drop by my personal website biosonix.io and drop a message if you would like to collaborate or need assistance with the code and development.