I have a MATLAB script that I could have sworn worked fine the last time I used it (a year ago). Now, I get this error:
Invalid file identifier. Use fopen
It also happens when trying to create a file in a non-existent directory. Try mkdir('folderName') within MATLAB or just create the directory beforehand.
mkdir('folderName')