How to unzip .bz2 file in Matlab?

21 次查看(过去 30 天)
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 个评论
Yoni Verhaegen -WE-1718-
编辑:Walter Roberson 2021-5-23
Hi, I solved it with this:
filename = 'cloudcover.grib2.bz2';
urlwrite(fullURL,filename);
cmd = sprintf("bzip2 -dk '%s'", filename);
system(cmd);
filename = 'cloudcover.grib2';

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by