Skip to content

codegen_array_ops

matlab_compat · scripts/matlab_compat/wave4/codegen_array_ops.m

CODEGEN_ARRAY_OPS  Documented MATLAB R2026a examples for codegen array ops.

  S = codegen_array_ops () returns a scalar struct with the reference
  results for the nexus#1708 / codg-004 example:

    A = [1 2 3; 4 5 6];
    size(A)      -> [2 3]
    size(A,1)    -> 2
    A(1,end)     -> 3
    A(end)       -> 6
    A(end,1)     -> 4
    1:2:5        -> [1 3 5]

  The C runtime that emits equivalent code is nx_array_t
  (libnexusinterp/codegen/nx_array.h).  When the interpreter build
  includes __nexus_codegen_array_ops__, that builtin's "demo" mode
  must match these values.

  See also codegen, size.