Specify file path problem

I am trying to specify a file path on a Mac and I get the following message;
>> data = load('/User/nickward/Desktop/Geostrophyreport/Matlab/profile021.txt'); Error using load Unable to read file '/User/nickward/Desktop/Geostrophyreport/Matlab/profile021.txt'. No such file or directory.
I have tried various combinations of path but none seem to work.
I am a total novice and the threads I have looked at don't seem to resolve the problem.
Thanks

 Risposta accettata

Chad Greene
Chad Greene il 3 Mar 2017

0 voti

On my Mac it's Users (plural), not User. Is that the issue?

7 Commenti

Nick Ward
Nick Ward il 3 Mar 2017
It doesn't seem to make a difference. It's as if the file isn't in the location, but it is as you can see on the left hand pane. Is there a particular way this should be added? It's just a .txt file. Thanks Nick
Chad Greene
Chad Greene il 3 Mar 2017
Dang, that's strange. You're already in that folder, so you shouldn't even need to specify the full file path. But it should work either way.
Is it the missing underscore in _021? What happens if you type
which 'profile_021.txt'
Nick Ward
Nick Ward il 3 Mar 2017
Yes it is :) Thanks very much for helping. I have tried with the underscore before but I must have also changed something else. Thanks again
Sindhu Sindhu
Sindhu Sindhu il 24 Mag 2023
I have a similar issue while reading the file in macbook - readpath = ('/Users/radhekrishna/Library/Mobile Documents/com~apple~CloudDocs'); it gives error. Please help me in this regard.
@Sindhu Sindhu what do these show in the command window:
dirList1 = dir('/Users/radhekrishna/Library/Mobile Documents')
dirList2 = dir('/Users/radhekrishna/Library/Mobile Documents/com~apple~CloudDocs')
Sindhu Sindhu
Sindhu Sindhu il 25 Mag 2023
still there is a error in loading files. How to load matfiles which is in a folder in macbook? please help.

Accedi per commentare.

Più risposte (0)

Categorie

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by