11 views (last 30 days)

I am trying to run an fplot command and the resulting plot does not give me my expected output. The fplot is full of horizontal colored lines that I have no idea how to eliminate or to troubleshoot.

See attached screenshot.

omega_b=1800;

X=-4/(1800^2);

m=0.003;

k=10720;

c=0.01;

omega_n=sqrt(k/m);

zeta=c/(2*m*omega_n);

r=omega_b/omega_n;

theta_1=atan((2*zeta*omega_n*omega_b)/(omega_n^2-omega_b^2));

theta_2=atan(omega_n/(2*zeta*omega_b));

y=omega_n*X*((omega_n^2+(2*zeta*omega_b)^2)/((omega_n^2-omega_b^2)^2+(2*zeta*omega_n*omega_b)^2))^0.5*cos(omega_b*t-theta_1-theta_2)

fplot(y,[0 6*pi()])

Walter Roberson
on 12 Nov 2019

Walter Roberson
on 12 Nov 2019

If you have the symbolic toolbox,

syms t

instead of defining t as a numeric vector.

If you do not have the symbolic toolbox, then define

t = linspace(0, 6*pi, 593);

and build up y, and then,

plot(t, y)

Opportunities for recent engineering grads.

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

Start Hunting!
## 0 Comments

Sign in to comment.