What causes an invalid file identifier in MATLAB?

前端 未结 11 2119
余生分开走
余生分开走 2020-12-06 13:21

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         


        
11条回答
  •  甜味超标
    2020-12-06 13:59

    The path with a forward slash at the beginning can cause the same error.

    filename = '/data/myfile.txt';
    

    throws this error, while

    filename = 'data/myfile.txt';
    

    does not produce an error.

提交回复
热议问题