This repository has been archived on 2021-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
scientificComputing/projects/project_activation_curve/solution/ivcurve.m

17 lines
343 B
Matlab

function [vsteps, peakcurrents] = ivcurve(vsteps, time, currents, tmax)
peakcurrents = zeros(1, length(vsteps));
for k = 1:length(peakcurrents)
c = currents((time>0.0)&(time<tmax), k);
minc = min(c);
maxc = max(c);
if abs(minc) > maxc
peakcurrents(k) = minc;
else
peakcurrents(k) = maxc;
end
end
end