Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% A Certain Capacitor
- % Determines the capacitive reactance at a certain frequency
- % Inputs and Variables
- R1 = input('Known resistance\n');
- f1 = input('Known frequency\n');
- a = input('Do you know the frequency or resistance?\n');
- switch a
- case 1
- f2 = input('Other frequency\n');
- R2 = R1*f1/f2;
- fprintf('The unknown capacitive reactance is %.3f Ohm\n ', R2)
- case 2
- R2 = input('Other resitance\n');
- f2 = R1*f1/R2;
- fprintf('The frequency is %.3f Hz\n', f2)
- end
- % Ouputs and Equations
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement