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
Use fullfile() to construct the full filename of the files you want to use in your code (your .mat files and other data files).
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.