필터 지우기
필터 지우기

Vectors must be the same length with plot of Shear Force Diagram

조회 수: 1 (최근 30일)
Rovindra Nauth
Rovindra Nauth 2020년 5월 11일
댓글: Rovindra Nauth 2020년 5월 12일
I'm not famililar with the error. If I run the plot for the moment diagram it works, but not for the shear force.
%% conversions
w = 4; % VDL in k/ft
d = 12; % Distance for VDL
P1 = w*d; % VDL to Point Load in kip
a = 6; % centroid of the point load
P2 = 60;
%% Reaction Forces
Ay = P1 + P2;
MA = P1*a + P2*20;
%% Consider the left of a section through a-a
x1 = linspace(0,12);
P3 = P1*x1;
% Equilibrium
Va = Ay - P3;
Ma = (Ay*x1)-(P3.*(x1/2))-MA;
%% Consider the right of a section through b-b
x2=linspace(12,20);
% Equilibrium
Vb = P2;
Mb = -60*(20-x2);
X = [x1 x2]; V = [Va Vb]; M = [Ma Mb];
subplot(211)
plot(X,V)
subplot(212)
plot(X,M)
-----------------------------
Error using plot
Vectors must be the same length.
Error in hibbler_SFBM_142 (line 32)
plot(X,V)

채택된 답변

Tommy
Tommy 2020년 5월 12일
If you look in the workspace, you should see that X has length 200 while V has length 101. If you want to plot V over X, they need to have the same length.
You create X by combining x1 and x2, both of which have length 100. Thus X has length 200.
You create V by combining Va and Vb, and while Va has length 100, Vb has length 1. Thus V has length 101.
Do you mean for Vb to equal P2 over the entire duration of x2? Then you could define it with this:
Vb = P2*ones(size(x2));
  댓글 수: 1
Rovindra Nauth
Rovindra Nauth 2020년 5월 12일
Vb equalts to P2 is the only load acting from the cut of the diagram.
I applied the Vb = P2*ones(size(x2)) code and it works. I wasn't aware I could have made that combination. Thank you for your assistance.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Data Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by