필터 지우기
필터 지우기

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