27 lines
643 B
Matlab
27 lines
643 B
Matlab
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 |