plot output current versus output voltage curves parametrized by input current for common emitter amplifier in matlab

main.m
% Define constants
Rc = 1e3; % Collector resistance
Vcc = 12; % Supply voltage
Re = 1e3; % Emitter resistance
beta = 100; % Current gain of the transistor

% Define range of input currents
Ib_values = 1e-3:0.1e-3:5e-3;

figure;
hold on;

for i = 1:length(Ib_values)
    Ib = Ib_values(i);
    Ic = beta * Ib;
    
    % Calculate output voltage
    Vout = Vcc - Ic * Rc;
    
    % Plot output current versus output voltage curve
    plot(Vout, Ic, 'o');
end

xlabel('Output Voltage (V)');
ylabel('Output Current (A)');
title('Common Emitter Amplifier Characteristic Curves');
grid on;
hold off;
596 chars
29 lines

gistlibby LogSnag