Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Error using ==> load Unable to read file XXX.mat: No such file or directory

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Tekin

Date: 26 Aug, 2010 09:51:04

Message: 1 of 12

dear all

i can not figure out why i am always getting same error
"Error using ==> load
Unable to read file XXX.mat: No such file or directory

any one can help me with this issue????

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Robert Cumming

Date: 26 Aug, 2010 10:03:04

Message: 2 of 12

"Tekin " <tekinerginoglu@gmail.com> wrote in message <i55de8$obi$1@fred.mathworks.com>...
> dear all
>
> i can not figure out why i am always getting same error
> "Error using ==> load
> Unable to read file XXX.mat: No such file or directory
>
> any one can help me with this issue????

are you 100% XXX.mat is in the current directory?

type (to list matlab files in current dir):

what

type :
exist ( 'XXX.mat' )

to check file exists (return should be 2)

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Tekin

Date: 26 Aug, 2010 23:30:27

Message: 3 of 12

"Robert Cumming" <rcumming@matpi.com> wrote in message <i55e4o$9qt$1@fred.mathworks.com>...
> "Tekin " <tekinerginoglu@gmail.com> wrote in message <i55de8$obi$1@fred.mathworks.com>...
> > dear all
> >
> > i can not figure out why i am always getting same error
> > "Error using ==> load
> > Unable to read file XXX.mat: No such file or directory
> >
> > any one can help me with this issue????
>
> are you 100% XXX.mat is in the current directory?
>
> type (to list matlab files in current dir):
>
> what
>
> type :
> exist ( 'XXX.mat' )
>
> to check file exists (return should be 2)


dear Robert
 when i run the file, matlab says:

matlab can not run this file because E:\......and settings\t.e\desktop\XXX.m shadows it in the current working folder. to run this file you must change the matlab current folder and it gives 3 options

1. change folder
2. cancel
3.help

when i hit the first option and run the file it gives same errors shown below again

Error using ==> load
Unable to read file mech_export.mat: No such file or
directory.

Error in ==> mech_export>mech_export_LayoutFcn at 540
load mech_export.mat

Error in ==> File mane>gui_mainfcn at 1352
        gui_hFigure = feval(gui_State.gui_LayoutFcn,
        gui_SingletonOpt);

Error in ==> file name at 17
    gui_mainfcn(gui_State, varargin{:});


PS: i use matlab 7.10.0 ( R20010a)

the answer is 0

exist ( 'mech_export.mat' )

ans =

     0

i would like to email you the file if thats ok

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Robert Cumming

Date: 27 Aug, 2010 07:29:05

Message: 4 of 12

"Tekin " <tekinerginoglu@gmail.com> wrote in message <i56tej$eph$1@fred.mathworks.com>...
> "Robert Cumming" <rcumming@matpi.com> wrote in message <i55e4o$9qt$1@fred.mathworks.com>...
> > "Tekin " <tekinerginoglu@gmail.com> wrote in message <i55de8$obi$1@fred.mathworks.com>...
> > > dear all
> > >
> > > i can not figure out why i am always getting same error
> > > "Error using ==> load
> > > Unable to read file XXX.mat: No such file or directory
> > >
> > > any one can help me with this issue????
> >
> > are you 100% XXX.mat is in the current directory?
> >
> > type (to list matlab files in current dir):
> >
> > what
> >
> > type :
> > exist ( 'XXX.mat' )
> >
> > to check file exists (return should be 2)
>
>
> dear Robert
> when i run the file, matlab says:
>
> matlab can not run this file because E:\......and settings\t.e\desktop\XXX.m shadows it in the current working folder. to run this file you must change the matlab current folder and it gives 3 options
>
> 1. change folder
> 2. cancel
> 3.help
>
> when i hit the first option and run the file it gives same errors shown below again
>
> Error using ==> load
> Unable to read file mech_export.mat: No such file or
> directory.
>
> Error in ==> mech_export>mech_export_LayoutFcn at 540
> load mech_export.mat
>
> Error in ==> File mane>gui_mainfcn at 1352
> gui_hFigure = feval(gui_State.gui_LayoutFcn,
> gui_SingletonOpt);
>
> Error in ==> file name at 17
> gui_mainfcn(gui_State, varargin{:});
>
>
> PS: i use matlab 7.10.0 ( R20010a)
>
> the answer is 0
>
> exist ( 'mech_export.mat' )
>
> ans =
>
> 0
>
> i would like to email you the file if thats ok

I suspect you have your directories mixed up.

What dir is you m file in
What is the current working directory (i.e. put "pwd" in your code)
What dir is your file "mech_export.mat" in

Try changing your "mech_export.mat" to include the full path then it will work, or add the directory where it is located to thepath (addpath)

emailing me the file wont help, its a local directory problem you have at your end.

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Tekin

Date: 28 Aug, 2010 00:35:27

Message: 5 of 12

"Robert Cumming" <rcumming@matpi.com> wrote in message <i57pg1$cav$1@fred.mathworks.com>...
> "Tekin " <tekinerginoglu@gmail.com> wrote in message <i56tej$eph$1@fred.mathworks.com>...
> > "Robert Cumming" <rcumming@matpi.com> wrote in message <i55e4o$9qt$1@fred.mathworks.com>...
> > > "Tekin " <tekinerginoglu@gmail.com> wrote in message <i55de8$obi$1@fred.mathworks.com>...
> > > > dear all
> > > >
> > > > i can not figure out why i am always getting same error
> > > > "Error using ==> load
> > > > Unable to read file XXX.mat: No such file or directory
> > > >
> > > > any one can help me with this issue????
> > >
> > > are you 100% XXX.mat is in the current directory?
> > >
> > > type (to list matlab files in current dir):
> > >
> > > what
> > >
> > > type :
> > > exist ( 'XXX.mat' )
> > >
> > > to check file exists (return should be 2)
> >
> >
> > dear Robert
> > when i run the file, matlab says:
> >
> > matlab can not run this file because E:\......and settings\t.e\desktop\XXX.m shadows it in the current working folder. to run this file you must change the matlab current folder and it gives 3 options
> >
> > 1. change folder
> > 2. cancel
> > 3.help
> >
> > when i hit the first option and run the file it gives same errors shown below again
> >
> > Error using ==> load
> > Unable to read file mech_export.mat: No such file or
> > directory.
> >
> > Error in ==> mech_export>mech_export_LayoutFcn at 540
> > load mech_export.mat
> >
> > Error in ==> File mane>gui_mainfcn at 1352
> > gui_hFigure = feval(gui_State.gui_LayoutFcn,
> > gui_SingletonOpt);
> >
> > Error in ==> file name at 17
> > gui_mainfcn(gui_State, varargin{:});
> >
> >
> > PS: i use matlab 7.10.0 ( R20010a)
> >
> > the answer is 0
> >
> > exist ( 'mech_export.mat' )
> >
> > ans =
> >
> > 0
> >
> > i would like to email you the file if thats ok
>
> I suspect you have your directories mixed up.
>
> What dir is you m file in
> What is the current working directory (i.e. put "pwd" in your code)
> What dir is your file "mech_export.mat" in
>
> Try changing your "mech_export.mat" to include the full path then it will work, or add the directory where it is located to thepath (addpath)
>
> emailing me the file wont help, its a local directory problem you have at your end.


Dear Robert

i would like to thank you very much for dealing with my situation

my m file is in E:\Documents and Settings\T.E\My Documents\MATLAB
the current working directory is
>> pwd

ans =

E:\Documents and Settings\T.E\My Documents\MATLAB

my mech_export file is in E:\Documents and Settings\T.E\My Documents\MATLAB

i still get the same errors.:(((((

i must doing something wrong but i dont know what

could you please explain what i need to do step by step i would be so happy

cheers

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Image Analyst

Date: 28 Aug, 2010 13:37:03

Message: 6 of 12

Tekin
Because you're not using the full path name (folder + base file name + extenstion), you don't really know what files are being referenced. I'd say that your mat file probably lives in the other folder where you have your other mfile of the same name. It's always a risky and dangerous practice to not use the FULL filename of the files.

Use fullfile() to construct the full filename of the files you want to use in your code (your .mat files and other data files).

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Robert Cumming

Date: 31 Aug, 2010 09:14:22

Message: 7 of 12

As I previosuly stated I didn't want you to email me the file, the problem is in your file system so whether the file works on another filesystem is irrelevant.

As in the last post from ImageAnalyst, you should use fullfile to force your code to load a particualr file, this will help eliminate problems.

Also step through your code
put a break point at the point where you want to load your mat file
Check the directory you are in
Check the directory your mat file is
Check you dont have a spelling mistake in your filename


Plus - if you dont want the file published on the internet, I'd advise in future you not to send it to a stranger! I haven't posted it, I haven't even opened it.

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Gezahagn

Date: 14 Jun, 2012 08:43:06

Message: 8 of 12

"Tekin" wrote in message <i55de8$obi$1@fred.mathworks.com>...
> dear all
>
> i can not figure out why i am always getting same error
> "Error using ==> load
> Unable to read file XXX.mat: No such file or directory
>
> any one can help me with this issue

Dear Tekin,
i do have the same problem, so how did you manage this error message in matlab?

Thank you
gezahagn

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Gezahagn

Date: 14 Jun, 2012 09:02:07

Message: 9 of 12

"Tekin" wrote in message <i55de8$obi$1@fred.mathworks.com>...
> dear all
>
> i can not figure out why i am always getting same error
> "Error using ==> load
> Unable to read file XXX.mat: No such file or directory
>
> any one can help me with this issue????

Dear all,
i do have the same problem , look at the error message

>> xxxxx
Error using load
Unable to read file C:\Dokumente: No such file or directory.

Error in xxxxx (line 18)
load C:\Dokumente und Einstellungen\yyyy.txt


Thank you
gezahagn

Subject: Error using ==> load Unable to read file XXX.mat: No such file

From: Nasser M. Abbasi

Date: 14 Jun, 2012 09:17:40

Message: 10 of 12

On 6/14/2012 4:02 AM, Gezahagn wrote:
> "Tekin" wrote in message<i55de8$obi$1@fred.mathworks.com>...
>> dear all
>>
>> i can not figure out why i am always getting same error
>> "Error using ==> load
>> Unable to read file XXX.mat: No such file or directory
>>
>> any one can help me with this issue????
>
> Dear all,
> i do have the same problem , look at the error message
>


>>> xxxxx
> Error using load
> Unable to read file C:\Dokumente: No such file or directory.
>
> Error in xxxxx (line 18)
> load C:\Dokumente und Einstellungen\yyyy.txt
>
>
> Thank you
> gezahagn


I do not get this error. Using Matlab 2012a

----------------------
EDU>> xxxxx
Undefined function or variable 'xxxxx'.
-----------------------

Try to contact technical support.

--Nasser

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Steven_Lord

Date: 14 Jun, 2012 13:29:53

Message: 11 of 12



"Gezahagn " <gis08gne@student.lu.se> wrote in message
news:jrc9af$pb6$1@newscl01ah.mathworks.com...
> "Tekin" wrote in message <i55de8$obi$1@fred.mathworks.com>...
>> dear all
>>
>> i can not figure out why i am always getting same error "Error using ==>
>> load
>> Unable to read file XXX.mat: No such file or directory
>>
>> any one can help me with this issue????
>
> Dear all,
> i do have the same problem , look at the error message
>>> xxxxx
> Error using load
> Unable to read file C:\Dokumente: No such file or directory.
>
> Error in xxxxx (line 18)
> load C:\Dokumente und Einstellungen\yyyy.txt

When the path to the file or the filename itself contains a space, like this
one does, you can't use the command form of LOAD. Instead you will need to
use the function form of LOAD. This:

load C:\Dokumente und Einstellungen\yyyy.txt

is equivalent to:

load('C:\Dokumente', 'und', 'Einstellungen\yyyy.txt')

which will not work unless you have a file Dokumente.mat in your root c:\
drive, and even if you did will error when you try to load a variable whose
name includes \ and . (period). On the other hand,

load('C:\Dokumente und Einstellungen\yyyy.txt')

will do what you want, assuming the file yyyy.txt in the directory
"C:\Dokumente und Einstellungen" is in a form LOAD can understand.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Error using ==> load Unable to read file XXX.mat: No such file or directory

From: Gezahagn

Date: 15 Jun, 2012 07:29:06

Message: 12 of 12

"Steven_Lord" <slord@mathworks.com> wrote in message <jrcp0h$b6$1@newscl01ah.mathworks.com>...
>
>
> "Gezahagn " <gis08gne@student.lu.se> wrote in message
> news:jrc9af$pb6$1@newscl01ah.mathworks.com...
> > "Tekin" wrote in message <i55de8$obi$1@fred.mathworks.com>...
> >> dear all
> >>
> >> i can not figure out why i am always getting same error "Error using ==>
> >> load
> >> Unable to read file XXX.mat: No such file or directory
> >>
> >> any one can help me with this issue????
> >
> > Dear all,
> > i do have the same problem , look at the error message
> >>> xxxxx
> > Error using load
> > Unable to read file C:\Dokumente: No such file or directory.
> >
> > Error in xxxxx (line 18)
> > load C:\Dokumente und Einstellungen\yyyy.txt
>
> When the path to the file or the filename itself contains a space, like this
> one does, you can't use the command form of LOAD. Instead you will need to
> use the function form of LOAD. This:
>
> load C:\Dokumente und Einstellungen\yyyy.txt
>
> is equivalent to:
>
> load('C:\Dokumente', 'und', 'Einstellungen\yyyy.txt')
>
> which will not work unless you have a file Dokumente.mat in your root c:\
> drive, and even if you did will error when you try to load a variable whose
> name includes \ and . (period). On the other hand,
>
> load('C:\Dokumente und Einstellungen\yyyy.txt')
>
> will do what you want, assuming the file yyyy.txt in the directory
> "C:\Dokumente und Einstellungen" is in a form LOAD can understand.
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Dear Steve,
i appreciated you help, really thank you very much, you got the solution for my problem . It works fine now.

Regards
gezahagn

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us