필터 지우기
필터 지우기

Dividing a beam of certain length in 10000 points and edit vector at point 0 mm

조회 수: 1 (최근 30일)
Hey,
I want to ride a Matlab programm where I can plot the shear forces and bending moments on a beam. For calculating the shear forces I solve a set of equations (forces and moments) and by knowing the reacting and acting forces I can plot the shear forces. My code for that is the following:
for i=1:length(Q(:,1))
q(1,Q(i,2)*10000/l:10000)=Q(i,1)+q(1,Q(i,2)*10000/l:10000);
end
where q ..... vector of shear forces (with 10000 points)
Q ..... Matrix with all acting and reacting forces
Q(:,1) contains the force itself (e.g. 100 N)
Q(:,2) contains the position of the forces
l ..... length of the beam
but when a force acts on the edge of the beam (for example at 0 mm when the beam is 100 mm long) I get an error because the second index of q would be zero.
How can I solve this problem? I really have no idea and would be very grateful if you could help me! Thanks!
  댓글 수: 2
Guillaume
Guillaume 2018년 10월 8일
Your equation is very odd. How do you ensure that Q(i, 2)*10000/l is a positive integer number?
Cedric Kotitschke
Cedric Kotitschke 2018년 10월 8일
편집: Cedric Kotitschke 2018년 10월 8일
Q(i,2) is the position of the force wich is always positive. If you take a beam which is 100 mm long the position value would need to be exact to the third decimal (like 30,125 mm) to be a non-integer which never happened in any of my problems. But nevertheless a good point. Do you have an suggestion on how to improve the code?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by