How to add a .mat file (including the file path) to a specific location in a Python script and save this Python script using matlab?
11 views (last 30 days)
Kenny Shu on 28 Aug 2018
You can write directly to the Python script using "fprintf":
replaceLine = 2
fid = fopen('mypyfile.py', 'r+');
fseek(fid, 0, 'cof');
Refer to the following link for additional information on writing data to text files:
Consider writing the MAT file location to an intermediate medium (such as a text file or database) in MATLAB and reading from that medium in Python.