Trouble loading .bin file

3 次查看(过去 30 天)
Ryan Oates
Ryan Oates 2015-2-21
评论: Guillaume 2015-2-22
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);

回答(1 个)

Guillaume
Guillaume 2015-2-21
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 个评论
Image Analyst
Image Analyst 2015-2-21
Attach the file, and attach your m-file script that demonstrates the problem.
Guillaume
Guillaume 2015-2-22
Well, your syntax for fread looks a bit off. Possibly, you mean:
a = fread(fid, Inf, 'float', 0, 'b');

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by