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
    • adamupdate
    • analyzeNetwork
    • bilstmLayer
    • classificationLayer
    • combvec
    • convolution1dLayer
    • crossentropy
    • dlarray
    • dlfeval
    • dlgradient
    • dlnetwork
    • dlupdate
    • eluLayer
    • exportONNXNetwork
    • featureInputLayer
    • forward
    • fullyConnectedLayer
    • globalAveragePooling1dLayer
    • layerGraph
    • layerNormalizationLayer
    • lstmLayer
    • padsequences
    • regressionLayer
    • reluLayer
    • sequenceInputLayer
    • softmaxLayer
    • trainingOptions
    • trainnet
    • trainNetwork

padsequences — Pad or truncate numeric sequence cell arrays.

padsequences(sequences, paddingDim) pads or truncates numeric sequences stored in a cell array along the requested dimension.

Syntax

Y = padsequences(sequences, paddingDim)
Y = padsequences(sequences, paddingDim, Name, Value)

How padsequences works

  • sequences must be a cell array of numeric scalar/vector/tensor sequences.
  • paddingDim is a required positive integer dimension.
  • PaddingDirection accepts left, right, or both; the default is right.
  • Length accepts longest, shortest, or a positive integer.
  • PaddingValue accepts a finite numeric scalar and defaults to 0.
  • UniformOutput defaults to true and stacks padded sequences into a numeric tensor; false preserves the input cell shape.

GPU memory and residency

padsequences materializes host sequence tensors in this slice; provider-resident sequence padding remains future GPU work.

Examples

Right Pad Sequences

Y = padsequences({[1 2], 3}, 2, 'PaddingValue', -1)

Expected output:

A numeric tensor with right-padded row sequences.

Preserve Cell Shape

C = padsequences({[1 2 3], [4 5]}, 2, 'Length', 2, 'PaddingDirection', 'left', 'UniformOutput', false)

Expected output:

A cell array whose first sequence keeps the tail `[2 3]`.

Using padsequences with coding agents

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

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

Related Deep Learning functions

adamupdate · analyzeNetwork · bilstmLayer · classificationLayer · combvec · convolution1dLayer · crossentropy · dlarray · dlfeval · dlgradient · dlnetwork · dlupdate · eluLayer · exportONNXNetwork · featureInputLayer · forward · fullyConnectedLayer · globalAveragePooling1dLayer · layerGraph · layerNormalizationLayer · lstmLayer · regressionLayer · reluLayer · sequenceInputLayer · softmaxLayer · trainingOptions · trainnet · trainNetwork

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
  • How padsequences works
  • GPU memory and residency
  • Examples
  • Right Pad Sequences
  • Preserve Cell Shape
  • Using padsequences with coding agents
  • Related Deep Learning functions
  • About RunMat