def save_variables_to_mat(file_path, variables, format='5'):
    """

    Parameters
    ---------
    file_path: str

    variables: dict
        Dictionary with objects. Object name -> object

    format : {'5', '4'}, string, optional
        '5' (the default) for MATLAB 5 and up (to 7.2),
        '4' for MATLAB 4 .mat files
        See scipy.io.savemat dostrings.
    """

    try:
        sio.savemat(file_path, variables, format=format)
    except IOError as ioe:
        raise IOError('Error saving to {}'.format(file_path)) from ioe
def save_variables_to_mat ( file_path , variables , format = '5' ) : try : sio . savemat ( file_path , variables , format = format ) except IOError as ioe : raise IOError ( 'Error saving to {}' . format ( file_path ) ) from ioe
Parameters
    ---------
    file_path: str

    variables: dict
        Dictionary with objects. Object name -> object

    format : {'5', '4'}, string, optional
        '5' (the default) for MATLAB 5 and up (to 7.2),
        '4' for MATLAB 4 .mat files
        See scipy.io.savemat dostrings.