'Load()' function cannot open a file though it exists
4 views (last 30 days)
Show older comments
Haiyun Xu
on 5 Nov 2017
Commented: Haiyun Xu
on 5 Nov 2017
Dear all,
I am facing this problem, where my file is located at exactly the location that I pass to my load() function but it stills prompts "Unable to read file 'location'. No such file or directory." I even used the exist() function to check the existence of that file (the answer is yes). What's going on?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/169193/image.jpeg)
0 Comments
Accepted Answer
Kaushik Lakshminarasimhan
on 5 Nov 2017
Your code is looking for a file called location which obviously doesn't exits. You need to use location as a variable name:
load(location)
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!