plot input current versus input voltage curves as function of output voltage for a common emitter bjt in matlab
main.m
% Define constantsVcc = 10; % Collector Supply VoltageRc = 1e3; % Collector ResistorRe = 500; % Emitter ResistorVt = 25e-3; % Thermal VoltageBeta = 100; % Beta value for BJT% Define range of output voltage valuesVout = linspace(0, Vcc, 100);
% Initialize arrays to store input current values for different output voltagesIin = zeros(size(Vout));
% Calculate input current for each output voltagefori = 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 BJTfigure;
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;