Does anyone know why my second conditional statement "units(1) ~= 'n'" is being ignored when this code block is run? When the 2nd statement is removed the code runs without problems.
units = strings([1,4]); torque_force_input = input('Input the unit of force for your initial torque\n','s'); units(1)= torque_force_input; while units(1) ~= 'N'||units(1) ~= 'n' disp('Please input a valid unit for the torque''s force.'); torque_force_input = input('Input a unit of force for your torque...\n','s'); units(1)= torque_force_input; end
Best Answer