plot input current versus input voltage curves as function of output voltage for a common emitter bjt in matlab

main.m
% Define constants
Vcc = 10; % Collector Supply Voltage
Rc = 1e3; % Collector Resistor
Re = 500; % Emitter Resistor
Vt = 25e-3; % Thermal Voltage
Beta = 100; % Beta value for BJT

% Define range of output voltage values
Vout = linspace(0, Vcc, 100);

% Initialize arrays to store input current values for different output voltages
Iin = zeros(size(Vout));

% Calculate input current for each output voltage
for i = 1:length(Vout)
    Ib = (Vcc - Vout(i)) / ((Beta + 1) * Re + Rc);
    Iin(i) = Beta * Ib + Ib;
end

% Plot input current versus input voltage curves for common emitter BJT
figure;
plot(Vout, Iin, 'LineWidth', 2);
xlabel('Output Voltage (V)');
ylabel('Input Current (A)');
title('Input Current vs Input Voltage for Common Emitter BJT');
grid on;
760 chars
27 lines

gistlibby LogSnag