RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • gunzip
    • gzip
    • unzip

unzip — Extract files from ZIP archives in MATLAB and RunMat.

unzip(zipfilename) extracts a ZIP archive into the current folder. unzip(zipfilename, outputfolder) extracts into the requested destination folder. The first argument can be a local file path or an HTTP/HTTPS URL, and filenames = unzip(...) returns a cell array of extracted file paths.

Syntax

unzip(zipfilename)
unzip(zipfilename, outputfolder)
filenames = unzip(___)

Inputs

NameTypeRequiredDefaultDescription
zipfilenameStringScalarYes—ZIP archive path or HTTP/HTTPS URL.
outputfolderStringScalarYes—Destination folder for extracted files.

Returns

NameTypeDescription
filenamesAnyCell array of extracted file paths.

Returned values from unzip depend on how many outputs the caller requests.

Errors

IdentifierWhenMessage
RunMat:unzip:InvalidArgumentArguments do not match supported unzip invocation forms.unzip: invalid argument
RunMat:unzip:FilenameZIP filename or URL is invalid.unzip: invalid ZIP filename
RunMat:unzip:OutputFolderOutput folder is invalid or cannot be created.unzip: invalid output folder
RunMat:unzip:HttpRemote ZIP archive cannot be downloaded.unzip: download failed
RunMat:unzip:ZipZIP archive cannot be decoded or contains unsupported entries.unzip: invalid ZIP archive
RunMat:unzip:UnsafePathZIP entry would escape the destination folder.unzip: unsafe archive path
RunMat:unzip:IoExtraction fails due to filesystem I/O.unzip: extraction failed
RunMat:unzip:OutputReturned filename cell array cannot be materialized.unzip: output materialization failed
RunMat:unzip:OutputCountCaller requests more outputs than unzip supports.unzip: unsupported output count

How unzip works

  • unzip(zipfilename) extracts all non-directory entries into the current working folder.
  • unzip(zipfilename, outputfolder) creates outputfolder when needed and extracts all entries beneath that folder.
  • unzip(url, outputfolder) downloads the archive over HTTP or HTTPS using RunMat's shared HTTP transport, then extracts it.
  • Returned filenames are a column cell array of character paths for regular files that were extracted. Directory entries are created as needed but are not included in the returned list.
  • Archive entries with absolute paths, user-relative paths, drive-prefixed names, or .. parent traversal are rejected before writing, preventing zip-slip extraction outside the destination folder.
  • Remote ZIP downloads are capped before extraction, and extracted bytes are counted while streaming each entry so malformed archives cannot grow without bound.
  • ZIP entries compressed with the standard deflate method are supported. Unsupported or malformed ZIP archives raise a RunMat:unzip:Zip diagnostic.
  • unzip is a host I/O sink. It suppresses statement-form auto output, and when called with zero requested outputs it still extracts files but returns no value.

Does RunMat run unzip on the GPU?

unzip is registered as a host I/O operation. Fusion groups terminate before archive extraction and no Accelerate provider hooks are used.

GPU memory and residency

No manual action is required. Path arguments are gathered to host values and extraction writes host filesystem files.

Examples

Extract into the current folder

unzip('sampleData.zip')

Extract into a specific output folder

files = unzip('sampleData.zip', 'data')

Download and extract a ZIP archive

files = unzip('https://example.com/sampleData.zip', tempdir)

Use the returned file list

files = unzip('measurements.zip', 'measurements');
firstFile = files{1};

Using unzip with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how unzip changes the result.

Run a small unzip example, explain the result, then change one input and compare the output.

FAQ

Does unzip create the destination folder?⌄

Yes. The output folder and any archive subfolders are created when needed.

Can unzip extract archives from URLs?⌄

Yes. HTTP and HTTPS URLs are downloaded with RunMat's shared HTTP transport before extraction.

Are directory entries returned in filenames?⌄

No. Directory entries are created, but the returned cell array contains regular extracted file paths.

How are unsafe ZIP paths handled?⌄

RunMat rejects entries that would escape the destination folder, including absolute paths, .. traversal, drive-prefixed names, and user-relative paths.

Does unzip run on the GPU?⌄

No. Archive extraction is filesystem and network I/O, so it always runs on the host.

Related Io functions

Archive

gunzip · gzip

Net

accept · read · readline · tcpclient · tcpserver · write

Repl Fs

addpath · cd · copyfile · delete · dir · exist · fileattrib · fileparts · fullfile · genpath · getenv · getpref · isenv · isfile · isfolder · ispref · ls · matlabroot · memmapfile · mkdir · movefile · open · opentoline · path · pathsep · pcode · pwd · readstruct · rehash · restoredefaultpath · rmdir · rmpath · run · savepath · setenv · setpref · system · tempdir · tempname · uigetdir · uigetfile · uiputfile · unsetenv · userpath · what · winqueryreg · xmlread · xmlwrite

Tabular

arrayDatastore · csvread · csvwrite · detectImportOptions · dlmread · dlmwrite · fileDatastore · parquetDatastore · parquetinfo · parquetread · readcell · readmatrix · readtable · readtimetable · spreadsheetImportOptions · writecell · writematrix · writetable · writetimetable · xlsread · xlswrite

Audio

audioinfo · audioread

Io

clc · diary · disp · display · format · input

Filetext

fclose · feof · fgetl · fgets · fileread · filewrite · fopen · fprintf · fread · frewind · fwrite · readlines · writelines

Hdf5

h5disp · h5info · h5read · h5write · h5writeatt · hdf5info · hdf5read · hdf5write

Import

importdata · textscan

Json

jsondecode · jsonencode

Mat

load · matfile · save

Http

sendmail · urldecode · urlencode · weboptions · webread · websave · webwrite

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how unzip is executed, line by line, in Rust.

  • View the source for unzip in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How unzip works
  • Does RunMat run unzip on the GPU?
  • GPU memory and residency
  • Examples
  • Extract into the current folder
  • Extract into a specific output folder
  • Download and extract a ZIP archive
  • Use the returned file list
  • Using unzip with coding agents
  • FAQ
  • Related Io functions
  • Archive
  • Net
  • Repl Fs
  • Tabular
  • Audio
  • Io
  • Filetext
  • Hdf5
  • Import
  • Json
  • Mat
  • Http
  • Open-source implementation
  • About RunMat