MATLAB: How to read or write a file according to its absolute path

text file

I read a txt file using importdata. I pass the name of txt file to that function. Instead to pass only the name I would pass the absolute path. The same thing when I write data on file using dlmwrite. I would pass to that function the absolute path where save the file.

Best Answer

I don't see any problem. I'm sure every Matlab function can deal with local files as well as with absolute paths.