"Baha Kuzu" <
ibah...@gmail.com> wrote in message
news:jf04m1$6ig$1...@newscl01ah.mathworks.com...
> I am trying to read thousands of files from web. But matlab "fullfile"
> does not allow for that because it changes forward slashes (" / ") to back
> slashes (" \ "), so this blocks urlread command to proceed. Example is
> below.
That is the expected behavior; FULLFILE is intended for use with _filenames_
not URLs and it uses the appropriate file separator for your OS.
http://www.mathworks.com/help/techdoc/ref/fullfile.html
"Build full *_FILE_* name from parts" [Emphasis mine.]
> __________________________________
> fname = 'HELENA/A-HMC180.at2';
> [pathstr, name, ext] = fileparts(fname); ext = '.AT2'; fname_url =
> fullfile(pathstr,[name ext]);
> initial = '
http://peer.berkeley.edu/nga_files/ath/'; record_URL1 =
> urlread(fullfile('
http://peer.berkeley.edu/nga_files/ath/', fname_url));
> ___________________________________
> Gives error, because of the backslashes. Anything to figure this out
> appreciated...
As others have said, use [] to concatenate the pieces of your URL together,
like:
URL = [initial fname]
--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com