gur111 icon

MS Word to Matlab matrix

gur111 | PRO | 04/14/20 11:39:38 AM UTC | 0 ⭐ | 660 👁️ | Never ⏰ | []
Python |

500 B

|

None

|

0 👍

/

0 👎

def to_matlab():
    beginning = "■("
    while True:
        str_mat = input("Enter a matrix (or matrice) in word format:\n")
        if(str_mat == "help"):
            print("Copy a matrix from work and paste it here")
            continue
            
        print(str_mat.replace(beginning, "").replace("&", " ") 
                      .replace("@", ";").replace("][", "]*[")
                      .replace(")]*", "]*").replace(")]", "]"))
 
 
if __name__ == "__main__":
    to_matlab()

Comments