How to download files online using Matlab?

20 ビュー (過去 30 日間)
Shayma Al Ali
Shayma Al Ali 2021 年 11 月 11 日
回答済み: Pavan Guntha 2021 年 11 月 16 日
I need to download many (like hundreds or thousands) of HDF files from an online database. What functions can I use so I can constuct a code that will allow me to download those files? I know theres webread and urlwrite but do those only work for HTML files?

回答 (1 件)

Pavan Guntha
Pavan Guntha 2021 年 11 月 16 日
Hello Shayma,
You could urlwrite function to download the files from an online database. The following steps can be followed to download the files:
1) Save of the URL of the file to be downloaded into a variable called 'url':
% NOTE: This URL has just been taken as an example to illustrate the
% process.
url = 'http://blizzard.mtukrc.org/~weather/KRCwthr050916.csv';
2) Use urlwrite to download the required file as follows:
urlwrite (url, 'KRCwthr050916.csv'); % 'KRCwthr050916.csv' is the output file name
You could also use webwrite function to store the output into a workspace variable.
For mor information on urlwrite, you could look at the documentation page here.
Hope this helps!

カテゴリ

Help Center および File ExchangeDownloads についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by