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

1 vue (au cours des 30 derniers jours)
JB
JB le 27 Juin 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.

Réponses (1)

Walter Roberson
Walter Roberson le 27 Juin 2015
Modifié(e) : Walter Roberson le 27 Juin 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);

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by