plot i-v for a common emitter bjt according to the ebers-moll equations in matlab
main.m
% Constantsq = 1.6e-19; % Charge of an electron in Coulombsk = 1.38e-23; % Boltzmann constant in J/KT = 300; % Temperature in Kelvin% BJT parametersIs = 1e-14; % Saturation current for the diodes in the BJTbeta = 100; % Common-emitter current gainVt = k*T/q; % Thermal voltage% VoltagesVcc = 10; % Collector voltageRc = 1e3; % Collector resistanceRe = 500; % Emitter resistanceVb = 0:0.01:1; % Base voltageIc = Is*(exp(Vb/Vt) - 1); % Collector currentIe = Ic; % Emitter current% Plotplot(Vb, Ie.*Re, 'b', Vb, Vcc/Rc - Ic*Rc, 'r'); % Blue line is the base current, red line is the collector currentxlabel('Base Voltage (V)');
ylabel('Current (A)');
legend('Base Current', 'Collector Current');