How to unzip .bz2 file in Matlab?

조회 수: 32 (최근 30일)
Yoni Verhaegen -WE-1718-
Yoni Verhaegen -WE-1718- 2020년 12월 20일
댓글: Walter Roberson 2021년 5월 23일
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-
Yoni Verhaegen -WE-1718- 2021년 5월 23일
편집: 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';
Walter Roberson
Walter Roberson 2021년 5월 23일

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by