Having trouble with Gunzip function in Matlab

12 ビュー (過去 30 日間)
M_D8993
M_D8993 2022 年 5 月 19 日
編集済み: Nihal Reddy 2022 年 6 月 1 日
Hello! Having a bit of a problem unzipping a .gz file with environmental data in MATLAB. I tried converting the file to .txt in R but it results in much of the data not being shown. I've included examples of the code that I've tried below and the errors that I've received. I have a Mac and tried using Terminal as well but that also does not work.
gunzip(/Users/[name]/Documents/MATLAB/filename.nc,outputdir)
Invalid use of operator.
gunzip(Users/minolidias/Documents/MATLAB/filename.nc)
gunzip(Users/[name]/Documents/MATLAB/runoff.filename.nc)
Invalid expression. Check for missing multiplication operator, missing or
unbalanced delimiters, or other syntax error. To construct matrices, use
brackets instead of parentheses.
gunzip(/Users/[name]/Documents/MATLAB/filename.nc)
gunzip(/Users/[name]/Documents/MATLAB/filename.nc)
Invalid use of operator.
  1 件のコメント
Star Strider
Star Strider 2022 年 5 月 19 日
Use quotes —
Uz1 = gunzip('/Users/[name]/Documents/MATLAB/filename.nc','outputdir')
Uz2 = gunzip('Users/minolidias/Documents/MATLAB/filename.nc')
.

サインインしてコメントする。

回答 (1 件)

Nihal Reddy
Nihal Reddy 2022 年 6 月 1 日
編集済み: Nihal Reddy 2022 年 6 月 1 日
From my understanding you are facing problem in unzipping a .gz file with environmental data in MATLAB R2022a. The input to the “gunzip” function must be a character vector, a cell array of character vectors, or a string array. This is the reason your code example seems to error out. You can modify your code examples as follows to run without any errors-
>> gunzip('/Users/[name]/Documents/MATLAB/filename.nc','outputdir')
>> gunzip('Users/minolidias/Documents/MATLAB/filename.nc')
You can refer to following MATLAB documentation link for more information-

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by