teaLeef
teaLeef

Reputation: 1989

Invalid file identifier in matlab

I'm trying to read a text file using textscan(fID,format). However, I get an error telling me Invalid file identifier. Use fopen to generate a valid file identifier. I used fopen to generate fID and got -1. I don't remember having ever seen an identifier to -1. Is it possible?

Upvotes: 0

Views: 757

Answers (1)

P0W
P0W

Reputation: 47854

If fopen cannot open the file, then fID is -1.

Possible Causes :

  • Wrong File Path.
  • Corrupt File.
  • File doesn't exist
  • File already in use.

Upvotes: 2

Related Questions