# MATLAB: The text file is always not opened when i use fopen!!

fopenmatrix

I am trying to use a fopen command on matlab on a text file, but it always give me a value of -1. and when i try to continue to use textscan it wont let do the work

exist(FileName, 'file')
[fileID, errmsg] = fopen(FileName);if fileID == -1  error(['Cannot open file: %s', char(10), '%s', errmsg);end