Graph figure wont show
이전 댓글 표시
clc;clear all;
l=25;
E=200e9;
I=350e-6;
w=6e3;
for x=linspace(0,l/2,25)
y=(-(w*x)/(384*E*I))*(16*(x^3)-24*l*(x^2)+9*(l^3))
end
for x=linspace(l/2,l,26)
y=(-(w*x)/(384*E*I))*(8*(x^3)-24*l*(x^2)+17*x*(l^2)-(l^3))
end
figure
plot(x,y)
채택된 답변
추가 답변 (1개)
Thorsten
2014년 11월 26일
Because your y is just a single point. Work on the whole vector and make sure to use .*, ./ and .^ when you want point-wise operation.
l=25;E=200e9;I=350e-6;w=6e3;
x=linspace(0,l/2,25); y=(-(w*x)/(384*E*I)).*(16*(x.^3)-24*l*(x.^2)+9*(l^3)) ;
plot(x, y, 'b')
hold on
x=linspace(l/2,l,26); y=(-(w*x)/(384*E*I)).*(8*(x.^3)-24*l*(x.^2)+17*x*(l^2)-(l^3));
hold on
plot(x, y, 'r')
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
