opentoline — Open a file to a requested editor line in MATLAB-compatible code.

opentoline(filename,line) resolves a file and validates a host-safe editor-navigation request. RunMat runtimes are noninteractive, so successful calls complete without launching an editor.

Syntax

opentoline(filename, line)
opentoline(filename, line, column)
opentoline(filename, line, column, option)

Inputs

NameTypeRequiredDefaultDescription
filenameStringScalarYesFile to open in the editor.
lineNumericScalarYesOne-based line number.
columnNumericScalarNo1One-based column number.
optionStringScalarNoEditor navigation option such as 'select'.

Errors

IdentifierWhenMessage
RunMat:opentoline:ArgumentCountThe call does not provide two to four input arguments.opentoline: expected filename, line, optional column, and optional option
RunMat:opentoline:InvalidFilenameThe filename is not a string scalar or row character vector.opentoline: filename must be a character vector or string scalar
RunMat:opentoline:InvalidPositionThe line or column argument is not a positive integer scalar.opentoline: line and column must be positive integer scalars

How opentoline works

  • opentoline(filename,line) accepts a string scalar, row character vector, or scalar string array filename plus a positive integer line number.
  • opentoline(filename,line,column) also validates a positive integer column number.
  • opentoline(filename,line,column,'select') accepts MATLAB-style selection intent as a no-op navigation option in noninteractive hosts.
  • Command-style numeric line and column arguments passed as text, such as opentoline file.m 10 4, are accepted when they parse as positive integers.
  • File names are resolved using the RunMat search path and the same general MATLAB-style file extensions used by open.
  • A missing file raises RunMat:opentoline:FileNotFound.
  • Non-scalar, nonfinite, fractional, zero, or negative line and column values raise RunMat:opentoline:InvalidPosition.
  • Requesting output arguments raises RunMat:opentoline:TooManyOutputs.

Does RunMat run opentoline on the GPU?

opentoline is a host-side editor navigation operation and does not participate in GPU fusion or provider-native execution.

Examples

Open a script at a line

opentoline('setup.m', 12)

Expected output:

% setup.m is resolved and the editor-navigation request succeeds without returned output.

Open a script at a line and column

opentoline('setup.m', 12, 4)

Expected output:

% RunMat validates the file, line, and column.

Use command-style text numbers

opentoline setup.m 12 4

Expected output:

% Text line and column arguments are parsed as positive integers.

Using opentoline with coding agents

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

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

FAQ

Does opentoline launch a desktop editor?

No. RunMat's runtime implementation is host-safe and noninteractive. It resolves the file and validates the requested position; the actual editor navigation completes as a no-op.

Why is this builtin under io/repl_fs instead of plotting?

opentoline is an editor/file navigation helper. It appeared in a plotting/UI token bucket, but its runtime ownership belongs with REPL-facing filesystem and editor-style operations.

Open-source implementation

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

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.