help plotting basic x vs y?

69 次查看(过去 30 天)
Hello, I am trying to plot x and y from x = 0 to x=L. Right now it goes haywire and plots a bunch of vertical lines which is not correct. Can someone tell me how to fix this? Thank you.
%constants
w0 =2.5 %kN/cm
L = 600 %cm
I = 30000 %cm^4
E = 50000; %kN/cm^2
%equation
y = @(x) w0./(120*E*I*L)*(-5*x^4+6*L^2*x^2-L^4);
x =linspace(0,L,100);
fplot(x,y)
ylabel('Displacement [cm]')
xlabel('Location [cm]')
title('Max Deflection at x = 531.2241cm')

采纳的回答

David Hill
David Hill 2019-9-20
x =linspace(0,L,100);
y =w0./(120*E*I*L)*(-5*x.^4+6*L^2*x.^2-L^4);
plot(x,y);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by