function I = K(V)
global G1 G2 V1 V2
% 
% Two resistors in parallel to generate the `N' IV-characteristics (of the
% K-channel
% Need |G2|>G1???
%

I1 = G1*V; % parallel resistor 1
I2 = (V>V1).*(V<=V2).*((-G1+G2)*(V-V1))+(V>V2).*((-G1+G2)*(V2-V1)); % parallel resistor 2
I = I1 + I2; % equivalent resistor by Kirchhoff's Laws.