- Author:
- JuliaMusgrave <jmus753@aucklanduni.ac.nz>
- Date:
- 2025-09-19 08:17:14+12:00
- Desc:
- Updated main scripts to provide more input to make it clear to the user which simulation is running
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/d52/rawfile/4bac6e1b6e7452bea431403085b0ca3d0c516b3b/MATLAB/twitch_analysis.m
% Quick function to calculate and return the amplitude and duration of a
% given twitch. Duration based on time to 95% relaxation
function [amp,t95]=twitch_analysis(twitch,t)
amp=max(twitch)-min(twitch);
[pks,idx]=findpeaks(-abs(twitch-min(twitch)-amp*0.05));
[~,i]=sort(pks,'descend');
idx=idx(i);
t95=abs(t(idx(2))-t(idx(1)));
end