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

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact
  • License
  • Privacy

Learn

  • Docs
  • Blog
  • Benchmarks
  • RunMat vs MATLAB Online

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.

/
See all docs
Builtin Reference
    • 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

fullfile — Build platform-correct file paths from path segments in MATLAB and RunMat.

fullfile joins path segments using the platform-specific separator to produce a single path string. It accepts any number of segments and returns a character row vector, with separator normalization and empty-segment handling matching MATLAB semantics.

Syntax

file = fullfile(part1)
file = fullfile(part1, part2, ...)

Inputs

NameTypeRequiredDefaultDescription
part1StringScalarYes—First path component.
partNStringScalarVariadic—Additional path components.

Returns

NameTypeDescription
fileStringScalarPlatform-correct joined path.

Errors

IdentifierWhenMessage
—No path arguments are supplied.fullfile: not enough input arguments
—A path argument is not a character vector, string scalar/array scalar, or tensor of character codes.fullfile: arguments must be character vectors or string scalars

How fullfile works

  • fullfile(part1, part2, ...) joins the inputs with the platform file separator (/ on macOS and Linux, \ on Windows).
  • Absolute path segments reset the accumulated path, mirroring MATLAB and OS path rules.
  • Empty segments are ignored, so fullfile("", "data") returns data.
  • Inputs must be character vectors or string scalars. Single-element string arrays are accepted. Other input types raise fullfile: arguments must be character vectors or string scalars.
  • The output is a character vector. Wrap the result with string(...) if you prefer string scalars.

Does RunMat run fullfile on the GPU?

fullfile performs string manipulation on the CPU only. Any GPU-resident inputs are gathered to the host before path assembly so the resulting character vector is always in CPU memory.

GPU memory and residency

No. fullfile is a host-side path builder. GPU-resident text inputs are gathered automatically, so there is no benefit to keeping path strings on the GPU.

Examples

Join Relative Path Segments

p = fullfile("data", "raw", "sample.dat")

Expected output:

p =
    data/raw/sample.dat

Use fullfile With pwd

root = pwd;
config = fullfile(root, "config", "settings.json")

Expected output:

% Returns a full path rooted at the current working folder

Build A Subfolder Path

logDir = fullfile("logs", "2026");
status = mkdir(logDir)

Expected output:

status =
     1

Create A File In A Nested Folder

mkdir(fullfile("data", "raw"));
fid = fopen(fullfile("data", "raw", "sample.dat"), "w");
fclose(fid)

Expected output:

% Creates data/raw/sample.dat

Using fullfile with coding agents

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

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

FAQ

Why does fullfile return a character vector instead of a string?⌄

MATLAB returns character vectors for fullfile. RunMat mirrors that behavior for compatibility; use string(fullfile(...)) if you prefer string scalars.

Does fullfile expand ~ to the home directory?⌄

No. fullfile performs string assembly only. Use cd or filesystem APIs that expand ~ when you need home expansion.

What happens if a segment is absolute?⌄

Absolute segments reset the accumulated path, matching MATLAB and OS path rules.

Can I pass numeric character codes?⌄

Yes. Numeric arrays that represent character codes are accepted as long as they form a row vector, just like other RunMat text inputs.

Does fullfile run on the GPU?⌄

No. It is a host-only utility and gathers GPU-resident inputs before processing.

Related Io functions

Repl Fs

addpath · cd · copyfile · delete · dir · exist · fileattrib · fileparts · 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

Net

accept · read · readline · tcpclient · tcpserver · write

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

Archive

gunzip · gzip · unzip

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 fullfile is executed, line by line, in Rust.

  • View the source for fullfile 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 fullfile works
  • Does RunMat run fullfile on the GPU?
  • GPU memory and residency
  • Examples
  • Join Relative Path Segments
  • Use fullfile With pwd
  • Build A Subfolder Path
  • Create A File In A Nested Folder
  • Using fullfile with coding agents
  • FAQ
  • Related Io functions
  • Repl Fs
  • Net
  • Tabular
  • Audio
  • Io
  • Filetext
  • Archive
  • Hdf5
  • Import
  • Json
  • Mat
  • Http
  • Open-source implementation
  • About RunMat