{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

This preview shows pages 1–3. Sign up to view the full content.

Using MATLAB to Make Plots Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition A 11 Copyright © Orchard Publications The ammeter readings were then recorded for each frequency. The magnitude of the impedance |Z| was computed as and the data were tabulated on Table A.1. Plot the magnitude of the impedance, that is, |Z| versus radian frequency . Solution: We cannot type (omega) in the MATLAB Command prompt, so we will use the English letter w instead. If a statement, or a row vector is too long to fit in one line, it can be continued to the next line by typing three or more periods, then pressing <enter> to start a new line, and continue to enter data. This is illustrated below for the data of w and z . Also, as mentioned before, we use the semi- colon ( ; ) to suppress the display of numbers that we do not care to see on the screen. The data are entered as follows: w=[300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900. ... 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000]; % z=[39.339 52.789 71.104 97.665 140.437 222.182 436.056. ... 1014.938 469.830 266.032 187.052 145.751 120.353 103.111. ... 90.603 81.088 73.588 67.513 62.481 58.240 54.611 51.468. ... 48.717 46.286 44.122 42.182 40.432 38.845]; Of course, if we want to see the values of w or z or both, we simply type w or z, and we press TABLE A.1 Table for Example A.10 ω (rads/s) |Z| Ohms ω (rads/s) |Z| Ohms 300 39.339 1700 90.603 400 52.589 1800 81.088 500 71.184 1900 73.588 600 97.665 2000 67.513 700 140.437 2100 62.481 800 222.182 2200 58.240 900 436.056 2300 54.611 1000 1014.938 2400 51.428 1100 469.83 2500 48.717 1200 266.032 2600 46.286 1300 187.052 2700 44.122 1400 145.751 2800 42.182 1500 120.353 2900 40.432 1600 103.111 3000 38.845 ZV A = ω ω

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Appendix A Introduction to MATLAB® A 12 Signals and Systems with MATLAB Computing and Simulink Modeling, Fourth Edition Copyright © Orchard Publications <enter> . To plot (y axis) versus (x axis), we use the plot(x,y) command. For this example, we use plot(w,z) . When this command is executed, MATLAB displays the plot on MATLAB’s graph screen and MATLAB denotes this plot as Figure 1. This plot is shown in Figure A.2. Figure A.2. Plot of impedance versus frequency for Example A.10 This plot is referred to as the magnitude frequency response of the circuit. To return to the command window, we press any key, or from the Window pull down menu, we select MATLAB Command Window . To see the graph again, we click on the Window pull down menu, and we choose Figure 1 . We can make the above, or any plot, more presentable with the following commands: grid on : This command adds grid lines to the plot. The grid off command removes the grid. The command grid toggles them, that is, changes from off to on or vice versa. The default * is off. box off : This command removes the box (the solid lines which enclose the plot), and box on restores the box. The command box toggles them. The default is on. title(‘string’) : This command adds a line of the text string (label) at the top of the plot. xlabel(‘string’) and ylabel(‘string’) are used to label the x and y axis respectively. The magnitude frequency response is usually represented with the x axis in a logarithmic scale.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}