I just started working with Matlab last week, so I'm very new. After searching for a while, I realized that I don't know how to fix a Matlab script that I'm working with. The problem is given below.
z(jω) = R + (jwl)/(1−(w^2)LC) If L = 1 mH, C = 10 μF, and R = 100 Ω, plot the magnitude of the input impedance for w = 10, 100, 1000, 1.0e04, and 1.0e05 rads/s.
This is all that I felt was necessary to solve this introductory problem:
L = 0.001; C = 0.00001; R = 100; z = @(w) (abs(R+(1j*w*L)/(1-(w.^2)*L*C))); W = [10 100 1000 10000 100000]; out = z(W); plot(W, out) xlabel('w (rad/s)') ylabel('z (ohms)')
but for some reason, 'out' is always a single number instead of a 1x5 matrix like W is. I have messed with it for a while now and tried to find out what's going on, but haven't gotten anywhere. Thanks in advance everyone.