Filter löschen
Filter löschen

Trouble loading .bin file

1 Ansicht (letzte 30 Tage)
Ryan Oates
Ryan Oates am 21 Feb. 2015
Kommentiert: Guillaume am 22 Feb. 2015
Hi,
I'm having trouble importing a .bin file on an FTP server. Below is the code. Any thoughts on why fopen is returning -1??
FULLurl = 'ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/Derived_Products/3B42RT/Daily/2001/3B42RT_daily.2001.03.01.bin';
fid = fopen(FULLurl, 'r');
a = fread(fid, 'float','b');
fclose(fid);

Antworten (1)

Guillaume
Guillaume am 21 Feb. 2015
Any thoughts on why fopen is returning -1?
That would because fopen is only for accessing the filesystem. It does not work over ftp (or http for that matter).
For ftp access, use the ftp class.
  3 Kommentare
Image Analyst
Image Analyst am 21 Feb. 2015
Attach the file, and attach your m-file script that demonstrates the problem.
Guillaume
Guillaume am 22 Feb. 2015
Well, your syntax for fread looks a bit off. Possibly, you mean:
a = fread(fid, Inf, 'float', 0, 'b');

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by