Use your knowledge of Electric Circuits to write a script fi
Solution
Matlab Script current.m
V = 5; % supply voltage
 for i = 1:3 % loop to run the test three times
 R1 = input(\' Enter the value of R1: \'); % input R1
 R2 = input(\' Enter the value of R2: \'); % input R2
 R3 = input(\' Enter the value of R3: \'); %input R3
 R23 = (R2*R3)/(R2+R3); % The value of R23
 Req = R1+R23; % total tesistence
 I1 = V/Req; % current I1
 I2 = I1*R23/R2; % current I2
 I3 = I1*R23/R3; % current I2
 fprintf(\'I1 = %fA I2 = %fA I3 = %fA\ \',I1,I2,I3); % Results
 end % end of loop
OUTPUT
>> current
 Enter the value of R1: 100
 Enter the value of R2: 200
 Enter the value of R3: 300
 I1 = 0.022727A I2 = 0.013636A I3 = 0.009091A
 Enter the value of R1: 300
 Enter the value of R2: 200
 Enter the value of R3: 100
 I1 = 0.013636A I2 = 0.004545A I3 = 0.009091A
 Enter the value of R1: 200
 Enter the value of R2: 300
 Enter the value of R3: 100
 I1 = 0.018182A I2 = 0.004545A I3 = 0.013636A

