How to unzip .bz2 file in Matlab?

14 Ansichten (letzte 30 Tage)
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- am 20 Dez. 2020
Kommentiert: Walter Roberson am 23 Mai 2021
How can I unzip the following .bz2 automatically in Matlab to reveal the grib file inside?
clear all
close all
fullURL1 = sprintf('https://opendata.dwd.de/weather/nwp/icon/grib/00/clch/icon_global_icosahedral_single-level_2020122000_000_CLCH.grib2.bz2');
fullURL = [fullURL1];
filename = 'highcloudcover.grb2.bz2';
urlwrite(fullURL,filename);
Thanks
  5 Kommentare
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- am 23 Mai 2021
Bearbeitet: Walter Roberson am 23 Mai 2021
Hi, I solved it with this:
filename = 'cloudcover.grib2.bz2';
urlwrite(fullURL,filename);
cmd = sprintf("bzip2 -dk '%s'", filename);
system(cmd);
filename = 'cloudcover.grib2';
Walter Roberson
Walter Roberson am 23 Mai 2021

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Install Products finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by