Why is this scipt resulting in a blank plot?

Hello I am relatively new to MatLab and I am currently trying to plot a 4th degree rational function.
The script is as follows:
hold on
m = 5.987*10^5; %mass of pendulum
M = 2.495*10^6; %mass of building
L = 12.6; %length of pendulum
k = 1.899*10^14; %building stiffness constant
g = 9.81;
w = [-50000 : 100 : 50000];
y = ((-w.^2*m*L^2+m*g*L)*k)/((-w.^2*(M+m)+k).*(-w.^2*m*L^2+m*g*L)-(w.^4*m^2*L^2));
plot(w,y);
The result is a blank plot with no curves on the figure. Any suggestions or solutions?
Thanks

 Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de Dic. de 2015
y = ((-w.^2*m*L^2+m*g*L)*k) ./ ((-w.^2*(M+m)+k).*(-w.^2*m*L^2+m*g*L)-(w.^4*m^2*L^2));

1 comentario

kevmister7
kevmister7 el 4 de Dic. de 2015
Thank you so much, I forgot that the division also needs to be entity division! Thanks again

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 4 de Dic. de 2015

Comentada:

el 4 de Dic. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by