Files
Probe/calc_gain.m
2026-04-13 17:04:35 +03:00

27 lines
643 B
Matlab
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
clear, clc
Riso = 2e6; % 2 МОм
Rf = 5e3; % 10 кОм (выбери сам)
% Данные: [Vin, V_after_divider, V_out]
data = [
1000, 1, 10;
100, 2, 10;
10, 0.2, 10
];
fprintf('\n=== РАСЧЁТ ===\n\n')
for i = 1:3
Vin = data(i,1);
V_div = data(i,2);
V_out = data(i,3);
Rmeas = (V_div * Riso) / (Vin - V_div);
Gain = V_out / V_div;
Rg = Rf / (Gain - 1); % для неинвертирующего
fprintf('%d В:\n', Vin)
fprintf(' Rmeas = %.1f кОм\n', Rmeas/1e3)
fprintf(' Усиление ОУ = x%.1f\n', Gain)
fprintf(' Rg = %.1f Ом\n\n', Rg)
end