Hello,
I have been trying to display the deflection and displacement of beams within a building. Currently, I am having an issue from within my loop which plots the displacement of each floor.
As you can see from the plot below, I have a red horizontal line from (0,0) to(2,0). Why is this? I think I have done something wrong in my "Displacement" loop but I am not sure
numFlr=2Phi_EigVec=[1 3;2 -3;]y1=zeros(numFlr,1);y2=zeros(numFlr,1);x1=zeros(numFlr,1);x2=Phi_EigVec(:,1);%Displacement
hold onfor i=1:numFlr y1(i)=i y2(i)=iA = [x1(:) x2(:)]; B = [y1(:) y2(:)];plot(A.',B.','r')end%Beam Deflection
AZero=[0]BZero=[0]AEven=A(:,2:2:end);BEven=B(:,2:2:end);AFull=[AZero,AEven']BFull=[BZero,BEven']plot(AFull.',BFull.','g')%Vertical Line
y=numFlrline([0,0],[0,y])%Axis
axis([-5 5 -1 5])
Best Answer