MATLAB: Downloading data with webread


I would like to download on a local folder files with extension .txt.gz. I tried using webread with options weboptions('KeyName','Accept-Encoding','KeyValue','gzip'), but I cannot understand how to simply save the file in .txt format. Any suggestions?

Best Answer

You can use gunzip:
url = '';
If you can't download the file with that, you'll need websave as an intermediary:
url = '';
file = websave('example.txt.gz',url);