'Write matrix `arr`, with name `name`
Parameters
arr : array_like
array to write
name : str
name in matlab workspace'

def write(self, arr, name):

    if scipy.sparse.issparse(arr):
        self.write_sparse(arr, name)
        return
    arr = np.asarray(arr)
    dt = arr.dtype
    if (not dt.isnative):
        arr = arr.astype(dt.newbyteorder('='))
    dtt = dt.type
    if (dtt is np.object_):
        raise TypeError('Cannot    save    object    arrays    in    Mat4')
    elif (dtt is np.void):
        raise TypeError('Cannot    save    void    type    arrays')
    elif (dtt in (np.unicode_, np.string_)):
        self.write_char(arr, name)
        return
    self.write_numeric(arr, name)
