def setup_open_matlab_ref(self, matlab_class_dir, matlab_ref_file_path):
def convert_type(x):<EOL><INDENT>try:<EOL><INDENT>return float(x)<EOL><DEDENT>except ValueError:<EOL><INDENT>return x<EOL><DEDENT><DEDENT>matlab_path = os.path.join(self.DIR_MATLAB_PATH, matlab_class_dir, matlab_ref_file_path)<EOL>if not os.path.exists(matlab_path):<EOL><INDENT>raise Exception("<STR_LIT>".format(matlab_path))<EOL><DEDENT>matlab_file = open(matlab_path,'<STR_LIT:r>')<EOL>uwg_matlab_val_ = [convert_type(x) for x in matlab_file.readlines()]<EOL>matlab_file.close()<EOL>return uwg_matlab_val_<EOL>
open the matlab reference file