Filter löschen
Filter löschen

Need help in accessing Year/Month/Date data from a ftp server

3 Ansichten (letzte 30 Tage)
JB
JB am 27 Jun. 2015
Bearbeitet: Walter Roberson am 27 Jun. 2015
Hello all,
I am interested in reading out the year/month/date data from the following site in my GUI. <ftp://goldsmr2.sci.gsfc.nasa.gov/data/s4pa/MERRA/MAT1NXRAD.5.2.0/>
I have tried the following in my code and it is opening the specific folder i.e of year 2015,January,1.(20150101)
f=ftp('goldsmr2.sci.gsfc.nasa.gov');
cd(f,'data/s4pa/MERRA/MAT1NXRAD.5.2.0/2015/01');
A = mget(f,'MERRA300.prod.assim.tavg1_2d_rad_Nx.20150101.hdf');
file_name = char(A);
Your help will be higly appreciated
Thanks alot in advance.

Antworten (1)

Walter Roberson
Walter Roberson am 27 Jun. 2015
Bearbeitet: Walter Roberson am 27 Jun. 2015
That code works for me, provided that my current directory in MATLAB starts as a directory I have write access to.
The only thing I would change would be as a matter of style. Instead of
file_name = char(A);
I recommend
file_name = A{1};
Also remember to
close(f);

Kategorien

Mehr zu Search Path finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by