optimizableVariable — Create Bayesian optimization variable metadata.

optimizableVariable(Name,Range) constructs a host metadata object describing a variable for Bayesian optimization workflows.

Syntax

v = optimizableVariable(Name, Range)
v = optimizableVariable(Name, Range, Name, Value)

How optimizableVariable works

  • The variable name must be a nonempty text scalar.
  • Numeric ranges must contain exactly two finite, increasing bounds and default to Type real.
  • Type accepts real, integer, and categorical; integer ranges must use whole-number bounds.
  • Categorical ranges are accepted as string arrays, scalar strings with explicit Type categorical, or cell arrays of text scalars and must be nonempty and unique.
  • Transform accepts none and log; log transforms require positive real lower bounds or nonnegative integer lower bounds and are not accepted for categorical variables.
  • Optimize accepts scalar logical values and defaults to true.
  • The result is an optimizableVariable compatibility object with Name, Range, Type, Transform, and Optimize properties.

GPU memory and residency

optimizableVariable constructs host metadata for bayesopt; gpuArray range and option inputs are gathered before validation.

Examples

Real Variable

v = optimizableVariable("depth", [1 10])

Expected output:

optimizableVariable compatibility object.

Categorical Variable

v = optimizableVariable("kernel", ["linear" "rbf"], "Type", "categorical")

Expected output:

optimizableVariable compatibility object.

Using optimizableVariable with coding agents

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

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

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.