Array indices must be positive integers or logical values
이전 댓글 표시
t sure where I went wrong.
w = 2.5; % UDL in kN/m
P=w*(3+1.2); % converting UDL to a Point Load, P
a=(3+1.2)/2; % Distance to the centroid
%% Shear Force & Bending Moment
By=P*a/3; % Vertical Loads
Ay=P-By;
x1=[0:0.1:3]; % Range from pin to roller
V1 = -w*x1+Ay;
M1 = -w*x1.^2 + Ay*x1;
x2=[3:0.1:4.2];
V2 = -w*x2+Ay+By;
M2 = (-w*x2.^2)/2 + Ay*x2 + By(x2-3);
%% Plotting the SF and BM Diagram
x=[x1 x2]; V=[V1 V2]; M=[M2 M2];
figure(1); plot(x,v)
figure(2); plot(x,m)
Array indices must be positive integers or logical values.
Error in SF_BM (line 19)
M2 = (-w*x2.^2)/2 + Ay*x2 + By(x2-3);

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!