USE MATLAB
6. Script m-file: Resistors in Series and In-Parallel When n electrical resistors are connected in series (one after another), the equivalent resistance is: R. = R1 + R2 +R; +...+R, = ER: R3 k=1 When electric resistors are connected in parallel, the equivalent resistance is: 1 1 1 R, = R1 R2 R3 + loop structure to cycle through n resistors. OR more efficiently: o have the user enter the values for all the resistors in a vector. calculate R. and Ry. You may do this using loop structures or using array operations (which method is more efficient?). If you use a loop structure, do not forget to clear R. and R, at the start of the m-file, otherwise you may accidentally include data from before. • output R. and Ry Make sure the user knows how to enter the information by displaying instructions and input prompts. 1 + Rn ++ n 1 = Σ- IR a. Write an m-file that computes and outputs equivalent resistance for n resistors in series, and for the same n resistors in parallel. The m-file should: • Ask the user to enter the values of the resistors. You may either o have the user enter the number of resistors, n, and then have the user enter values for each resistor individually. You will need to create a b. Show your electronic file to the instructor for testing c. Print your completed m-file.
USE MATLAB
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
USE MATLAB
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!