Need help with graphing program

2 次查看(过去 30 天)
Joseph
Joseph 2014-2-27
回答: Iain 2014-2-27
Create a matlab program to compute the magnitude and phase angle of the impedance(Z) of an RLC series circuit.
Given:
R= 2(resistance in ohms)
L=4e-3(inductance in henries)
C= 10e-6 (capacitance in farads)
Z= R + ((w*L)-(1/(w*C)))*i (impedance in V/A)
:Create a vector of angular frequencies from 1000 1/s to 10000 1/s in steps of 250.
:Create a Z vector for each frequency
:Create a vector containing the magnitude of Z for each frequency
:Create a vector containing the phase angle of Z for each frequency
:Comput the resonant frequency w0 = 1/sqrt(L*C)
:Present results in table and graphs

回答(1 个)

Iain
Iain 2014-2-27
You have your formulae, you just need to make them work.
angular_freqs = 1000:250:10000;
.* and ./ do elementwise multiplication and division.
A = [1;2;3;4;5]; B = -A;
[A B] % makes a table get printed out
plot(A,B) %plots "B" on the y axis and A on the x axis, of a graph.
Any more help than that is me doing your homework for you.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by