#NEWLINE# def read_workspace_vars( fname ) : #NEWLINE# #INDENT# fp = open ( fname , 'rb' ) #NEWLINE# rdr = MatFile5Reader ( mdict , struct_as_record = True ) #NEWLINE# vars = rdr . get_variables ( ) #NEWLINE# fws = vars [ '__function_workspace__' ] #NEWLINE# ws_bs = io . BytesIO ( fws . tostring ( ) ) #NEWLINE# ws_bs . seek ( 2 ) #NEWLINE# rdr . mat_stream = ws_bs #NEWLINE# mi = rdr . mat_stream . read ( 2 ) #NEWLINE# rdr . byte_order = ( ( ( mi == b'IM' ) and '<' ) or '>' ) #NEWLINE# rdr . mat_stream . read ( 4 ) #NEWLINE# mdict = read_minimat_vars ( rdr ) #NEWLINE# fp . close ( ) #NEWLINE# return mdict