I am trying to write a script that requests user input for belt angle β(beta), friction coefficient μ(mu), and one of the forces F2. The script then computes the corresponding force F1, and reports the answer using a disp([ ]) sentence. This is my code thus far:
prompt= 'State the belt angle beta: '; beta = input(prompt, 's');%degrees
prompt= 'State the friction coefficient mu: '; mu = input(prompt, 's'); prompt= 'State the Force F2: '; F2 = input(prompt, 's');%Newtons
F1 = F2.*exp(mu.*beta);%Newtons format bank disp(['The corresponding force F1 is ',num2str(F1), '.']);
My script is called BeltForces.m and the result I get is this:
>> BeltForcesState the belt angle beta: 130State the friction coefficient mu: 0.3State the Force F2: 100The corresponding force F1 is Inf Inf Inf.
Why am I getting infinity? My teacher told us to watch out for radians and to "Be careful with β, because math operations like e and sin require unitless input arguments."….Could this be why I am getting infinity?
Best Answer