17 lines
343 B
Matlab
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
|
|
|