for loop or while loop?
Show older comments
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
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!