- Author:
- JuliaMusgrave <jmus753@aucklanduni.ac.nz>
- Date:
- 2025-07-28 16:07:05+12:00
- Desc:
- Add CellML files for simulating isometric twitches with input Ca data
- Permanent Source URI:
- https://staging.physiomeproject.org/workspace/d52/rawfile/46f7f7a1a7d3f51fe4406e67990db8f2576649c5/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