Question: I'm having trouble creating a check for the input on my function. I want the function to return status=0 and Out_Torque= 0 if anything other

I'm having trouble creating a check for the input on my function. I want the function to return status=0 and Out_Torque= 0 if anything other than "N" "lb" "oz" "kN" is entered for Units of Force and likewise for "ft" "in" "mm" "m" for Units of Length. I've tried using an "if" statement before the main switch-case but it seems to ruin the rest of the code. Please help.
function (success, Out_Torque) = convertTorque (In_Torque, Unof, UnoL, DesF, Desl ) success=0; Out_Torque=0; forceconv=0; lengthconv=0; switch UnoF case "N" switch DesF case "N" forceconv= 1; case "16" forceconv=(1/(0.453592 9.80665)); case "oz" forceconv=(16/(0.453592 * 9.80665)); case "N" forceconv=(1/1000); end case "kN" switch DesF case "N" forceconv= 1000; case "lb" forceconv= (1000/(0.453592 9.80665)); case "oz" forceconv= 16 (1000/(0.453592 * 9.80665)); case "KN" forceconv= 1; end case "lb
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
