Advertisement
gur111

MS Word to Matlab matrix

Apr 14th, 2020
356
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. def to_matlab():
  2.     beginning = "■("
  3.     while True:
  4.         str_mat = input("Enter a matrix (or matrice) in word format:\n")
  5.         if(str_mat == "help"):
  6.             print("Copy a matrix from work and paste it here")
  7.             continue
  8.            
  9.         print(str_mat.replace(beginning, "").replace("&", " ")
  10.                       .replace("@", ";").replace("][", "]*[")
  11.                       .replace(")]*", "]*").replace(")]", "]"))
  12.  
  13.  
  14. if __name__ == "__main__":
  15.     to_matlab()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement