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: scale_matrix.m
    path of file: ./repos/lrslibrary/algorithms/td/RLRT/utils
    
    the code of the file until where you have to start completion: function X = scale_matrix( X, s, mode )
% X = rectangular matrix whose rows or cols are to be scaled
% s = diag of the scaling diag matrix
% mode = 0  row scaling
%      = 1  col scaling

    
function X = scale_matrix( X, s, mode )
% X = rectangular matrix whose rows or cols are to be scaled
% s = diag of the scaling diag matrix
% mode = 0  row scaling
%      = 1  col scaling

% prod = sparse( size(X,1), size(X,2) );
if mode
%     for j = 1:size(X,2)
%         X( :, j ) = X(:,j) * s(j);
%     end