'Write variables in `mdict` to stream
Parameters
mdict : mapping
mapping with method ``items`` return name, contents pairs
where ``name`` which will appeak in the matlab workspace in
file load, and ``contents`` is something writeable to a
matlab file, such as a numpy array.
write_header : {None, True, False}
If True, then write the matlab file header before writing the
variables.  If None (the default) then write the file header
if we are at position 0 in the stream.  By setting False
here, and setting the stream position to the end of the file,
you can append variables to a matlab file'

def put_variables(self, mdict, write_header=None):

    self._matrix_writer = VarWriter4(self)
    for (name, var) in mdict.items():
        self._matrix_writer.write(var, name)
