필터 지우기
필터 지우기

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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by