MATLAB Answers


how to download data from website?

Asked by Lola SE on 23 Mar 2019
Latest activity Commented on by Lola SE on 30 Mar 2019
Dear all,
I am trying to download data from the following website
my problem is I can not get the files, meaning only the html been located to my computer. (below what I used to locat the link into my machine)
what I need is getting the files separtly and read them.
Thanks for the help.


Sign in to comment.

1 Answer

Answer by Akira Agata
on 26 Mar 2019
 Accepted Answer

How about the following?
url = '';
str = webread(url);
links = regexp(str,'https://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?(\.nc)','match')';
data = cell(size(links));
for kk = 1:numel(links)
data{kk} = webread(links{kk});
By running this, all the .nc files are downloaded and stored in the cell array data.

  1 Comment

Thank you so much!!!

Sign in to comment.