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

 채택된 답변

Steven Lord
Steven Lord 2020년 5월 11일

0 개 추천

You're missing the multiplication operator between By and (x2-3).

댓글 수: 1

Thank you. I also saw there are a few more errors in the plot section. So I've corrected it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2020년 5월 11일

댓글:

2020년 5월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by