Download a file from a website?

조회 수: 24 (최근 30일)
Ara
Ara 2022년 8월 6일
편집: Ara 2022년 8월 12일
Dear All,
I have a code to download data from a website. It downolad it but the folder is empty inside init. Do you know where the problem is?

채택된 답변

Walter Roberson
Walter Roberson 2022년 8월 6일
편집: Walter Roberson 2022년 8월 6일
  댓글 수: 22
Walter Roberson
Walter Roberson 2022년 8월 11일
I tested the code on my system (Mac). For example,
>> ls /private/var/folders/jq/wx1hzy713dj_408tpm5fck040000gn/T/cosmic2013/001/cosmic2013/scnLv1/2013.001/
scnLv1_C001.2013.001.00.00.0004.G08.03_2013.3520_nc scnLv1_C002.2013.001.02.02.0033.G14.01_2013.3520_nc scnLv1_C002.2013.001.18.53.0027.G16.01_2013.3520_nc scnLv1_C005.2013.001.08.12.0008.G10.01_2013.3520_nc
scnLv1_C001.2013.001.00.01.0001.G22.02_2013.3520_nc scnLv1_C002.2013.001.02.03.0001.G20.02_2013.3520_nc scnLv1_C002.2013.001.18.54.0001.G05.02_2013.3520_nc scnLv1_C005.2013.001.08.18.0001.G04.02_2013.3520_nc
scnLv1_C001.2013.001.00.02.0001.G31.02_2013.3520_nc scnLv1_C002.2013.001.02.04.0019.G02.01_2013.3520_nc scnLv1_C002.2013.001.18.54.0023.G19.01_2013.3520_nc scnLv1_C005.2013.001.08.18.0001.G28.03_2013.3520_nc
(and more)
I did not test it on Windows (I am not sure I have a functioning Windows MATLAB installed at the moment.)
Ara
Ara 2022년 8월 11일
편집: Ara 2022년 8월 11일
It's been a 20 minutes that Matlab is busy to only extract two day 1 and 2. The folder 1 is still empty. How could it be possible to not work in Windows? I have to extract 365 days.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ara
Ara 2022년 8월 11일
Dear Walter,
It works. For folder 1 completely downloaded all data. Thank you very much. Only problem is very slow and gets busy for ~25min for one file. Is there any way to improve it?
  댓글 수: 3
Walter Roberson
Walter Roberson 2022년 8월 12일
You are mostly being limited by the speed of your internet connection.
If you change the assignment
td = tempdir();
you could change the download directory to an SSD if you have one. That could potentially make the untar step faster.
Ara
Ara 2022년 8월 12일
편집: Ara 2022년 8월 12일
Oh, I see! Yes the internet connection is not very good.
SSD means external memory? Would it be possible to download it all files in it instead of C? I do not know how to change it. Wouldyou please let me know how to change the path to the current folder or specifically in the external memory?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by