フィルターのクリア

help plotting basic x vs y?

22 ビュー (過去 30 日間)
Raphael Hatami
Raphael Hatami 2019 年 9 月 20 日
コメント済み: Raphael Hatami 2019 年 9 月 20 日
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);
  1 件のコメント
Raphael Hatami
Raphael Hatami 2019 年 9 月 20 日
Thanks David!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by