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: mixit.m
    path of file: ./repos/Coursera-Mastering-Programming-with-MATLAB/Week3-Potpourri/4-Mixed_Mode_Arithmetic
    
    the code of the file until where you have to start completion: function s = mixit(S,w)
    if size(S,2) ~= length(w)

    
function s = mixit(S,w)
    if size(S,2) ~= length(w)
        s = [];
    else
        w = w(:);                           % make sure it is a column vector
        S = 2 * double(S) / (2^16 - 1) - 1; % scale and shift it to the interval [-1 1]
        s = S * w;                          % matrix multiplication does what we need
        if max(abs(s)) > 1                  % make sure to stay within range
            s = s / max(abs(s));
        end