Question: Create an m-File (Not function) An engineer had measured impedances of a collection of electrical components and created a text file - impedance.txt - based

Create an m-File (Not function)

An engineer had measured impedances of a collection of electrical components and created a text file -

impedance.txt - based on the numerical data. You will find that impedance.txt on Canvas. The first

column of the file is real part of the impedance and the second column is the imaginary part of the

impedance. Row number indicates the number of components.

What you should do

Create m-file that

(1) will read the impedance.txt and find the row number (You can use size function)

(2) compute magnitude and phase (angle) of impedance of individual component

(3) Save the result on a variable Impedance_Polar

(4) Save the result on a text file Impedance_Polar.txt

(5) Also have this following message displayed on the screen (There are ### components in the

file impedance.txt. The Conversion of Cartesian format of complex number into Polar is completed and

the result is saved on Impedance_Polar.txt)

(6) Do this with FOR LOOP and WHILE LOOP (in other words, create two script one with for loop

and one with while loop)

impedence.txt

9 10

5 10

10 13

9 7

11 8

11 6

11 14

5 11

5 9

8 11

10 10

11 11

9 10

13 12

12 10

14 14

10 7

8 6

6 6

11 5

12 9

9 9

5 8

7 12

6 11

7 12

9 14

10 14

9 6

13 6

10 11

14 5

11 10

14 10

7 13

11 9

7 8

11 11

11 12

5 10

7 8

7 6

11 10

13 7

8 5

12 12

11 7

5 9

11 11

8 8

14 12

5 8

9 11

9 12

9 9

12 5

8 8

12 9

9 7

5 6

6 13

12 9

9 13

6 8

8 12

11 8

6 13

12 12

7 8

14 7

7 12

12 14

6 8

7 11

5 9

10 13

11 12

10 6

9 13

11 14

11 10

11 13

11 10

14 6

7 6

12 9

7 12

6 13

11 12

9 8

9 10

11 5

12 6

8 6

11 11

9 9

13 6

13 9

7 6

11 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!