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
    • cross
    • ctranspose
    • dot
    • mldivide
    • mpower
    • mrdivide
    • mtimes
    • pagemtimes
    • pagetranspose
    • trace
    • transpose

pagetranspose — Apply the nonconjugate transpose to every matrix page of an array.

Y = pagetranspose(X) swaps the first two dimensions of X on every page without conjugating complex values. For N-D arrays, each output page Y(:,:,i,j,...) is the nonconjugate transpose of X(:,:,i,j,...).

Syntax

Y = pagetranspose(X)

Inputs

NameTypeRequiredDefaultDescription
XAnyYes—Input scalar or array value.

Returns

NameTypeDescription
YAnyInput value with the first two dimensions swapped on every page.

Errors

IdentifierWhenMessage
RunMat:pagetranspose:InvalidArgumentCall does not provide exactly one input argument.pagetranspose: expected exactly one input argument
RunMat:pagetranspose:InvalidInputInput type is unsupported for page-wise transpose.pagetranspose: unsupported input type
RunMat:pagetranspose:InternalRuntime cannot materialize the page-wise transpose output.pagetranspose: internal runtime failure

How pagetranspose works

  • Equivalent to permute(X,[2 1 3:ndims(X)]) for dense arrays.
  • Works for scalars, vectors, matrices, and N-D arrays; only the first two axes are swapped.
  • Complex values are not conjugated. Compose with conj when Hermitian page transpose semantics are needed.
  • All eight integer classes, logical, character, string, and cell arrays preserve their element type while their first two dimensions are swapped. Integer payloads, including values above flintmax, are permuted without a floating conversion.
  • Sparse matrices transpose through RunMat's sparse CSC transpose path.
  • Scalar structs are treated as 1-by-1 values and round-trip unchanged; true struct-array permutation will follow RunMat's struct-array representation when that lands.
  • gpuArray inputs remain device-resident when a provider is available; unsupported integer layouts use transparent exact-owner gather and class-preserving restoration.

Does RunMat run pagetranspose on the GPU?

pagetranspose uses the same provider permute hook as permute(X,[2 1 3:ndims(X)]).

If the provider lacks a native hook, RunMat gathers, performs the page-wise transpose on the host, and uploads the result back to the provider.

GPU memory and residency

Yes for explicit gpuArray inputs when an acceleration provider is available.

Examples

Transpose each page of a 3-D array

A = reshape(1:12, [2 3 2]);
B = pagetranspose(A);
size(B)

Expected output:

ans = [3 2 2]

Preserve complex values without conjugation

Z = reshape([1+2i 3-4i], [1 2 1]);
Y = pagetranspose(Z)

Expected output:

Y =
   1.0000 + 2.0000i
   3.0000 - 4.0000i

Use pagetranspose as the page-wise form of transpose

A = rand(5, 3, 10);
B = pagetranspose(A);
size(B)

Expected output:

ans = [3 5 10]

Transpose gpuArray pages while preserving residency

G = gpuArray(rand(4, 2, 8));
H = pagetranspose(G);
isgpuarray(H)

Expected output:

ans = logical 1

Using pagetranspose with coding agents

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

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

FAQ

How does pagetranspose differ from transpose?⌄

For dense arrays they use the same first-two-dimension swap. pagetranspose names the page-wise intent explicitly for N-D arrays and mirrors MATLAB's page-wise API.

Does pagetranspose conjugate complex numbers?⌄

No. It is the page-wise nonconjugate transpose.

What happens to dimensions three and higher?⌄

They stay in the same order and size. Only dimensions one and two are swapped.

Is the result a view?⌄

No. RunMat materializes a new value, although GPU providers may optimize the data movement internally.

Related Linalg functions

Ops

cross · ctranspose · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · trace · transpose

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Factor

chol · decomposition · eig · eigs · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Open-source implementation

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

  • View the source for pagetranspose 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 pagetranspose works
  • Does RunMat run pagetranspose on the GPU?
  • GPU memory and residency
  • Examples
  • Transpose each page of a 3-D array
  • Preserve complex values without conjugation
  • Use pagetranspose as the page-wise form of transpose
  • Transpose gpuArray pages while preserving residency
  • Using pagetranspose with coding agents
  • FAQ
  • Related Linalg functions
  • Ops
  • Structure
  • Factor
  • Solve
  • Open-source implementation
  • About RunMat