for loop or while loop?
이전 댓글 표시
hi i need to write a program, but i dont know how to programming. I need to find a length l (l>0) so this way b1 and b2 are equal. b1 and b2 are functions dependent of l(variable) p,w,e,t are values that i already have. I need to iterate using increments of 0.001 and display l and b1. Please help me! :(
e=1800, t=120
First case: p=1000, w=0
Second case: p=0, w=12.5
Third case: p=500, w=12.5
p=input('point load: ') ;
w=input (' distributed load: ') ;
e=input (' normal stress: ');
t=input ('shear stress: ');
syms l b1 b2
for l=0:100000
l=l+0.001
b1= ((3*(p*l+0.5*w*l*l))/(32*e))^(1/3);
b2 =((3*(p+w*l))/(16*t))^(1/2);
if b1==b2
display l
display b1
display b2
end
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!