To open a file with write permission in Matlab, you can use the "fopen" function with "w" as the second argument. Here's an example:
main.m34 chars2 lines
This will create (if it does not exist yet) and open the file called "filename.txt" in write mode. If the file already exists, it will be truncated to zero length.
After you finish writing to the file, remember to close it with "fclose":
main.m13 chars2 lines
This will release the file handle and free system resources.
gistlibby LogSnag