You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pwm2cmd.m
    path of file: ./repos/LADAC/actuators
    
    the code of the file until where you have to start completion: % pwm2cmd converts a command in the range of 1000~200
    
function u_01 = pwm2cmd(u_PWM,is_reversed) %codegen

    reverse_factor = ones(size(is_reversed));
    reverse_factor(is_reversed) = -1;

    u_01 = 0.5 + ( u_PWM - 1500 ) / 1000 .* reverse_factor;

end