Nelson banner
Nelson Documentation

Nelson: Scientific Computing Environment Programming Language.

Nelson is an open-source scientific computing environment designed for numerical analysis, data visualization, and algorithm development.

Nelson provides mathematical functions, structured data types, and visualization tools for numerical computing workflows.

This documentation serves as your complete reference guide to Nelson's built-in functions, module system, and programming capabilities - from basic mathematical operations to advanced computational tasks.

Functions manager

Functions manager provides tools to manage and interact with Nelson's function search path and function types.

It includes commands to add or remove directories from the search path, execute built-in functions, clear built-in functions, evaluate functions, and more.

Utilities are available to check for the existence of built-in, macro, or mex functions.

Modules manager

The Modules Manager in Nelson provides the infrastructure to extend and manage the environment at runtime.

It allows modules to be dynamically added, removed, and queried, making the system flexible and adaptable to different workflows.

With support for both internal and external modules, the manager handles module metadata, paths, and versioning.

It also provides utilities for organizing user-defined toolboxes, managing gateways, and ensuring that dependencies are properly loaded.

This framework simplifies module distribution, integration, and maintenance, forming the backbone of Nelson’s modular architecture.

Core

The Core module provides the fundamental building blocks of the Nelson environment.

It includes essential services for program execution, environment management, and system interaction.

Through this module, users can evaluate code dynamically, manage execution flow, query program state, and access key system information such as versioning, configuration, and licensing.

It also offers basic utilities for file identification, checksums, cryptography (the crypto namespace: hashes, HMAC, Ed25519 and X25519, Argon2, authenticated encryption and secure random), and terminal capabilities.

Together, these features form the foundation upon which all other modules and user-level functionality in Nelson are built.

Engine

The Engine module manages the execution environment of Nelson itself.

It provides mechanisms to handle program startup and shutdown behavior, command-line integration, and runtime modes.

This includes support for user-defined initialization and termination scripts, platform-specific system requirements, and interpreter directives for cross-platform script execution.

It serves as the core interface between Nelson and the underlying operating system, ensuring flexible configuration and smooth control over how the software is launched and operated.

Interpreter functions

The Interpreter Functions module provides the core language constructs and control mechanisms that define the execution flow in Nelson.

It includes essential elements such as loops, conditional branching, error handling, and function declarations.

The module also offers tools for parsing and analyzing code, working with keywords, and managing recursion limits.

Together, these features establish the fundamental syntax and semantics of the Nelson language, enabling users to write structured, dynamic, and reliable programs.

Error manager

The Error Manager module provides the mechanisms for handling errors and warnings in Nelson.

It defines how exceptions are created, raised, and rethrown, as well as how diagnostic information can be retrieved after an error or warning occurs.

It lets programs control execution after failures, capture diagnostic reports, and display warnings without stopping execution.

It provides the common error and warning primitives used by Nelson code.

Console

The Console module manages interaction with Nelson’s command window.

It provides tools to control the display, handle user input, and query terminal properties.

These features allow scripts and applications to communicate directly with the user through the console, making it easier to build interactive workflows and adapt output to the current terminal environment.

Text completion

The Text completion module provides completion candidates for Nelson command lines, editors, and terminals.

Display format

The Display Format module defines how values, variables, and expressions are presented in Nelson.

It offers control over numeric formatting, text representation, and the way results are shown in the console.

The module also provides mechanisms for capturing formatted output programmatically, enabling both human-readable display and programmatic handling of results.

This ensures flexibility in how information is presented and reused within scripts and applications.

Characters encoding

The Characters Encoding module provides tools for converting between native byte representations and Unicode characters.

It enables scripts to correctly interpret and manipulate text in various encodings, ensuring compatibility across different platforms and locales.

The module also detects character sets that match a given input for text processing and internationalization.

Localization functions

The Localization module manages language settings and internationalization in Nelson.

It provides mechanisms to query available languages, determine the current and default language, and change the interface language dynamically.

This module adapts Nelson to linguistic and regional settings and supports multilingual interfaces.

I18n functions

The i18n module provides tools for internationalization and localization of text within Nelson.

It retrieves translated strings for the current locale, provides utilities for translation workflows, and generates translation file headers.

This module helps developers create software that can adapt dynamically to multiple languages and cultural contexts.

Types module

The Types module provides tools for managing and inspecting data types in Nelson.

It provides functions to query variable types, distinguish numeric, logical, string, and object values, and work with specialized types such as sparse or integer arrays.

The module also supports creation of objects and validation of variable names, helping ensure type safety and consistency across scripts and functions.

For C++ extension and embedding code, see C++ value API.

Logical type functions

The Logical Type module provides tools for working with Boolean values and logical operations in Nelson.

It enables the creation, conversion, and manipulation of logical data, supporting fundamental logical operations that are essential for control flow, conditional evaluation, and decision-making in scripts and programs.

Single type

The Single Type module provides tools for handling single-precision numeric values in Nelson.

It enables conversion of variables to single-precision format, allowing efficient storage and computation while maintaining sufficient numeric accuracy for many applications.

Double

The Double Type module provides tools for handling double-precision numeric values in Nelson.

It enables conversion to double precision and offers access to key numeric limits, supporting high-accuracy computations and reliable handling of large or small floating-point numbers in mathematical and scientific applications.

Integers type

The Integer Types module provides tools for working with signed and unsigned integers of various sizes in Nelson.

These types are particularly useful for efficiently storing and processing large datasets, such as images or large numeric arrays.

The module supports conversions between integer formats and provides access to the minimum and maximum values representable for each integer type, ensuring safe and precise integer arithmetic.

Sparse type

The Sparse Type module provides tools for creating and manipulating sparse matrices in Nelson.

It supports efficient storage and computation for matrices with a large number of zero elements, including conversion between sparse and full representations, generation of special sparse matrices, and access to nonzero elements.

This module enables memory-efficient handling of large datasets and optimized numerical operations on sparse structures.

String type

The String Type module provides functions for creating, manipulating, and analyzing text in Nelson.

It supports conversion between character arrays and string arrays, concatenation, trimming, justification, and case conversion.

The module also includes functions for searching, matching, replacing, and formatting strings, enabling flexible text processing for both simple and complex string operations.

Create and Convert Text

Functions for creating text, formatting text, and converting between text and other data.

Text Properties

Functions for checking text type, length, and character properties.

  • isStringScalar
    checks if input is string array with one element.
  • isletter
    Determine which characters are letters.
  • isspace
    Determine which characters are space.
  • isstrprop
    Determine character categories.
  • strlength
    Length of strings in cell of strings or string array.
Find and Replace

Functions for locating, counting, erasing, and replacing text.

  • contains
    checks if string contains with pattern.
  • count
    Computes the number of occurrences of an pattern.
  • endsWith
    checks if string ends with pattern.
  • erase
    Erase matching text.
  • eraseBetween
    Erase text between boundaries.
  • findstr
    Find one character vector inside another.
  • replace
    Replaces strings in another.
  • replaceBetween
    Replace text between boundaries.
  • startsWith
    checks if string starts with pattern.
  • strfind
    Find a string in another.
  • strmatch
    Find strings that start with text.
  • strrep
    Replaces strings in another.
Patterns

Pattern-building functions and boundary definitions for text matching.

Regular Expressions

Regular expression search, replacement, translation, and pattern helpers.

Join, Split, and Extract

Functions for extracting parts of text and combining or splitting text values.

Edit Text

Functions for trimming, padding, inserting, reversing, and changing text case.

  • deblank
    Remove trailing whitespace.
  • insertAfter
    Insert text after a boundary.
  • insertBefore
    Insert text before a boundary.
  • lower
    Convert text to lowercase.
  • pad
    Pad text to a requested width.
  • reverse
    Reverse characters in text.
  • strip
    Remove leading and trailing characters from text.
  • strjust
    Justify strings
  • strtrim
    Remove leading and trailing whitespace.
  • tolower
    Lower case conversion.
  • toupper
    Upper case conversion.
  • upper
    Convert text to uppercase.
Compare Text

Functions for comparing and matching text values.

  • matches
    Determine if pattern matches with strings.
  • strcmp
    Strings comparison.
  • strcmpi
    Strings comparison (case insensitive).
  • strncmp
    Compares first n characters of strings.
  • strncmpi
    Compares first n characters of strings (case sensitive).
Function_handle functions

The Function Handle Type module provides tools for creating and managing function handles in Nelson.

It supports anonymous functions, conversion between strings and function handles, and verification of function handle objects.

This module enables flexible and dynamic function invocation, allowing functions to be passed, stored, and executed programmatically.

Handle

The Handle module provides tools for creating and manipulating handle objects in Nelson.

Handle objects are lightweight references to larger data structures, enabling efficient memory management and data sharing between different parts of a program.

This module includes functions for creating, copying, and destroying handle objects, as well as for managing their lifetimes and ensuring proper cleanup.

It also includes classdef reflection, event, listener, dynamic property, weak reference, and typed invalid handle helpers.

Data structures

The Data Structures module provides tools for creating, manipulating, and inspecting arrays, cells, and structures in Nelson.

It enables conversion between different data formats, access and modification of fields, application of functions to array elements, and organization of structured data.

This module handles complex data through programmatic operations and dynamic data management.

Dictionaries

The Dictionary module provides tools for working with key-value mappings in Nelson.

It supports creation and configuration of dictionaries with defined key and value types, querying and modifying entries, and managing the overall structure.

This module enables efficient storage, retrieval, and manipulation of data indexed by unique keys, making it ideal for associative arrays, lookups, and dynamic data management.

Tables

The Tables module provides tools for creating, accessing, and manipulating tabular data in Nelson.

Tables are array-like structures with named variables (columns), each capable of holding different data types.

Table metadata is available through T.Properties, and helper functions are provided for adding, moving, renaming, removing and summarizing variables.

Timetables store tabular variables together with row times and provide time-based sorting, retiming, synchronization, and range queries.

Create and Convert Tables

Functions for creating tables and timetables and converting between tabular and other data forms.

Read and Write Tables

Pages for reading and writing table data.

Summary Information

Functions for table size, type checks, and quick previews.

  • head
    Get top rows of table or array.
  • height
    Number of table rows
  • istable
    Determine if input is table.
  • istabular
    Determine if input is a tabular object.
  • istimetable
    Determine if input is a timetable.
  • tail
    Get bottom rows of table or array.
  • width
    Number of table variables
Sort, Filter, and Rearrange

Functions and topics for accessing, sorting, rearranging, and customizing table contents.

Join and Set Operations

Functions for combining tables with joins and related operations.

Apply Functions to Table Contents

Functions and topics for direct calculations and applying functions to table rows or variables.

Timetables and Events

Functions for timetable ranges, events, synchronization, and retiming.

  • containsrange
    Determine if timetable row times contain a time range.
  • eventtable
    Create an event table for a timetable.
  • extractevents
    Extract an event table from rows of a timetable.
  • isregular
    Determine if timetable row times are regularly spaced.
  • issortedrows
    Determine if timetable rows are sorted.
  • lag
    Shift timetable data by rows.
  • overlapsrange
    Determine if timetable row times overlap a time range.
  • retime
    Adjust timetable data to new row times.
  • syncevents
    Add and synchronize the variables of the attached event table to a timetable.
  • synchronize
    Synchronize timetables to common row times.
  • timerange
    Time range for timetable row subscripting.
  • withinrange
    Find timetable rows within a time range.
  • withtol
    Time tolerance for timetable row subscripting.
Categorical arrays

The Categorical module provides arrays whose elements belong to a fixed set of text categories.

Overloading

The Overloading module provides mechanisms for customizing the behavior of functions and operators in Nelson.

It defines how standard operations or built-in functions behave when applied to user-defined types or objects.

This capability enables the extension of Nelson’s language features, supporting more natural and expressive use of custom data structures.

Operators

The Operators module provides tools for performing arithmetic, logical, relational, and array operations in Nelson.

It supports element-wise and matrix computations, concatenation, subscripted referencing and assignment, and short-circuit logical operations.

This module enables flexible manipulation of data structures and numerical arrays, forming the foundation for both basic calculations and advanced mathematical expressions.

Constructors functions

The Constructors module provides tools for creating fundamental numeric values, scalars, vectors, and matrices in Nelson.

It includes constants, identity and diagonal matrices, and special values such as infinity, NaN, and machine precision.

This module forms the basis for initializing data structures and performing mathematical and numerical computations.

Elementary functions

The Elementary Functions module provides fundamental mathematical operations and matrix manipulations in Nelson.

It includes numeric computations, array and matrix operations, complex number handling, rounding and scaling, and various utility functions for querying properties of arrays and matrices.

The module also supports construction of special matrices, grids, and sequences, enabling robust and efficient implementation of mathematical algorithms and numerical analyses.

Array Creation and Shape

Functions for creating, reshaping, and arranging arrays.

  • blkdiag
    Block diagonal matrix
  • deal
    Distribute inputs to outputs.
  • linspace
    linearly spaced vector constructor.
  • logspace
    logarithmically spaced vector constructor.
  • meshgrid
    Cartesian rectangular grid in 2-D or 3-D.
  • ndgrid
    Rectangular grid in N-D space
  • repelem
    Repeat copies of array elements.
  • repmat
    Replicate and tile an array.
  • reshape
    Reshapes a vector or a matrix to a different size matrix.
  • squeeze
    Remove dimensions of length 1.
Elementary Math

Elementary numerical functions, norms, rounding, powers, roots, logarithms, and remainders.

  • abs
    Absolute value
  • bsxfun
    Apply element-wise function with implicit expansion.
  • ceil
    Round up
  • clip
    Limit values to a range.
  • exp
    Exponential
  • expm1
    Compute exp(x) - 1.
  • factorial
    Factorial function
  • fix
    Round towards zero
  • floor
    Round down
  • hypot
    Square root of sum of squares
  • idivide
    Integer division with rounding option.
  • log
    Natural logarithm.
  • log10
    Common logarithm (base 10).
  • log1p
    log(1 + x) accurately for small values of x.
  • log2
    dissect floating-point numbers into base 2 exponent and mantissa.
  • maxk
    k largest elements of an array
  • mink
    k smallest elements of an array
  • mod
    Modulus after division.
  • nchoosek
    Binomial coefficient or combinations.
  • nextpow2
    Exponent of next higher power of 2
  • norm
    Matrix and vector norms
  • normest
    2-norm estimate
  • nthroot
    The real 𝑛th root of real number.
  • perms
    All possible permutations.
  • pinv
    Moore-Penrose pseudoinverse
  • pow2
    Base 2 exponentiation and scaling of floating-point numbers.
  • rat
    Rational fraction approximation.
  • rats
    Rational output.
  • rem
    Remainder after division.
  • round
    Round to nearest integer
  • sign
    Find the sign function of a number.
  • sqrt
    Square root.
Complex Numbers

Functions for complex values and real-valued variants of elementary functions.

  • angle
    Phase angle
  • complex
    Creates an complex number.
  • conj
    Complex conjugate
  • imag
    Imaginary part of an complex number.
  • real
    Real part of an complex number.
  • reallog
    Natural logarithm with real-only result.
  • realpow
    Element-wise power with real-only result.
  • realsqrt
    Square root with real-only result.
  • unwrap
    Shift phase angles to remove jumps.
Base Conversions

Functions for numeric base conversion, type conversion, and byte order.

  • base2dec
    Convert number in a base to decimal.
  • bin2dec
    Convert number in base 2 to decimal.
  • bin2num
    Convert two's complement binary string to number.
  • cast
    Converts variable to a different data type
  • dec2base
    Convert decimal number to another base.
  • dec2bin
    Convert decimal number to base 2.
  • dec2hex
    Convert decimal number to base 16.
  • hex2dec
    Convert number in base 16 to decimal.
  • hex2num
    Convert an IEEE hexadecimal representation to a number.
  • num2bin
    Convert number to binary representation.
  • num2hex
    Convert a number to its IEEE hexadecimal representation.
  • swapbytes
    Swap byte ordering.
  • typecast
    Convert data type without changing underlying data.
Matrix Generation

Functions for generating special matrices.

Indexing and Dimensions

Functions for indexing, dimensions, shape checks, rearrangement, and structural predicates.

  • allfinite
    Check if all array elements are finite.
  • circshift
    Circular shift
  • filter
    1-D digital filter
  • find
    Find Non-zero Elements
  • flip
    Flip order of elements
  • flipdim
    Flip array along specified dimension
  • fliplr
    Flip order of elements left to right
  • flipud
    Flip order of elements up to dow
  • histc
    Histogram count with explicit edges.
  • histcounts
    Histogram bin counts.
  • histcounts2
    Bivariate histogram bin counts.
  • ind2sub
    Linear index to matrix subscript values
  • ipermute
    Inverse permute array dimensions.
  • isapprox
    Return true if arguments are approximately equal, within the precision.
  • iscolumn
    Determine whether input is column vector.
  • istriu
    Checks if matrix is diagonal.
  • isequal
    Return true if all arguments x1, x2, ... , xn are equal (same dimensions, same values).
  • isequaln
    Return true if all arguments x1, x2, ... , xn are equal (same dimensions, same values or NaNs).
  • isequalto
    Return true if all arguments x1, x2, ... , xn are equal (same type, same dimensions, same values or NaNs).
  • isequalwithequalnans
    Compare arrays while treating NaN values as equal.
  • isfinite
    Check for finite entries.
  • isinf
    Check for Infinity entries.
  • ismatrix
    determines whether input is matrix or not
  • isnan
    Check for Not a Number entries.
  • isrow
    Determine whether input is row vector.
  • isscalar
    Check if the input is a scalar
  • istril
    Checks if matrix is lower triangular.
  • istriu
    Checks if matrix is upper triangular.
  • isvector
    Checks input is vector.
  • length
    Length of an object.
  • ndims
    Number of dimensions of an array.
  • numel
    Number of elements.
  • permute
    Permute array dimensions.
  • rot90
    Rotate array 90 degrees.
  • shiftdim
    Shift array dimensions
  • size
    Size of an object.
  • sortrows
    Sort rows of an array.
  • sub2ind
    Matrix subscript values to linear index
  • substruct
    Create structure argument for subsasgn or subsref
  • tril
    Lower triangular part of matrix
  • triu
    Upper triangular part of matrix
Trigonometric functions

The Trigonometric Functions module provides functions for trigonometric calculations in Nelson.

It includes standard trigonometric functions such as sine, cosine, and tangent, as well as their inverses and hyperbolic counterparts. The module supports angle measurements in both degrees and radians, allowing for flexible computations based on user preferences.

The module also provides utilities for converting between degrees and radians in mathematical and engineering calculations.

Special functions

The Special Functions module provides tools for performing advanced mathematical operations in Nelson.

It includes functions for statistical distributions, combinatorial calculations, and other specialized mathematical computations that are essential in various scientific and engineering applications.

This module enhances Nelson's capabilities by offering a range of functions that support complex analyses and modeling tasks.

Linear algebra

The Linear Algebra module provides matrix and vector computation functions in Nelson.

It includes functions for matrix factorization, decomposition, inversion, and analysis, as well as operations on eigenvalues, singular values, and subspaces.

The module includes numerical methods for evaluating matrix properties, condition numbers, and transformations used in linear algebra problems.

Linear Systems

Functions for solving, analyzing, and measuring linear systems and vector or matrix quantities.

  • cumtrapz
    Cumulative trapezoidal numerical integration.
  • del2
    Discrete Laplacian.
  • det
    Matrix determinant.
  • diff
    Differences and approximate derivatives.
  • gradient
    Numerical gradient.
  • inv
    Matrix inverse.
  • kron
    Kronecker tensor product.
  • null
    Null space of a matrix.
  • orth
    Range space of a matrix.
  • rank
    Rank of matrix.
  • rref
    Gauss-Jordan elimination.
  • subspace
    Angle between two subspaces.
  • tensorprod
    Tensor products between two arrays.
  • trace
    Matrix trace.
  • trapz
    Trapezoidal numerical integration.
  • vecnorm
    Vector-wise norm.
Decompositions

Matrix factorization and plane rotation functions.

  • chol
    Cholesky factorization.
  • hess
    Hessenberg form of a square matrix.
  • lu
    LU matrix factorization.
  • planerot
    Givens plane rotation.
  • qr
    QR matrix factorization.
Eigenvalues and Singular Values

Functions for eigenvalue, singular-value, and Schur computations.

  • balance
    Diagonal scaling to improve eigenvalue accuracy.
  • eig
    Eigenvalues and eigenvectors.
  • eigs
    Selected eigenvalues and eigenvectors of a sparse matrix.
  • rsf2csf
    Convert real Schur form to complex Schur form.
  • schur
    Schur decomposition.
  • svd
    Singular Value Decomposition.
  • svds
    Selected singular values and singular vectors of a sparse matrix.
Matrix Functions

Functions that evaluate elementary functions on matrices.

  • expm
    Computes the matrix exponential of a square matrix.
  • logm
    Computes the matrix logarithm of a square matrix.
  • pagectranspose
    Page-wise complex conjugate transpose.
  • pageinv
    Page-wise matrix inverse.
  • pagemtimes
    Page-wise matrix multiplication.
  • pagenorm
    Page-wise matrix or vector norm.
  • pagetranspose
    Page-wise transpose.
  • sqrtm
    Computes the matrix square root of a square matrix.
Matrix Properties

Functions for condition estimates, structure checks, and matrix properties.

  • bandwidth
    Lower and upper matrix bandwidth.
  • cond
    Condition number for inversion.
  • condeig
    Condition number with respect to eigenvalues.
  • condest
    1-norm condition number estimate.
  • isbanded
    Determine if matrix is within specific bandwidth.
  • ishermitian
    Computes if matrix is hermitian or skew-hermitian.
  • issymmetric
    Computes if matrix is symmetric.
  • rcond
    Inverse condition number.
Iterative Solvers

Iterative solvers for linear systems.

  • bicg
    BiConjugate gradients method for sparse linear systems.
  • bicgstab
    BiConjugate gradients stabilized method.
  • cgs
    Conjugate gradients squared method for sparse linear systems.
  • gmres
    Generalized minimum residual method.
  • lsmr
    LSMR method for sparse linear equations and least squares.
  • lsqr
    LSQR method for sparse linear equations and least squares.
  • minres
    Minimum residual method for symmetric or Hermitian sparse systems.
  • pcg
    Preconditioned conjugate gradients method.
  • qmr
    Quasi-minimal residual method for sparse linear systems.
Preconditioners

Incomplete factorization functions used as preconditioners.

  • ichol
    Incomplete Cholesky factorization.
  • ilu
    Incomplete LU factorization.
Statistics

The Statistics module provides tools for analyzing and summarizing data in Nelson.

It includes functions for computing measures of central tendency, variability, correlation, and probability distributions.

The module also supports advanced data summarization structures for accurate quantile estimation, enabling robust statistical analysis and interpretation of datasets.

Descriptive Statistics and Visualization

Functions for summarizing, exploring, ranking, and visualizing statistical data.

  • bootci
    Bootstrap confidence interval.
  • bootstrp
    Bootstrap sampling.
  • corr
    Linear or rank correlation.
  • corrcoef
    Correlation coefficients
  • cov
    Covariance
  • crosstab
    Cross-tabulation.
  • ecdf
    Empirical cumulative distribution function.
  • geomean
    Geometric mean of a data set.
  • harmmean
    Harmonic mean of a data set.
  • hist
    Histogram bin counts.
  • histfit
    Histogram with fitted distribution curve.
  • iqr
    Interquartile range.
  • jackknife
    Jackknife statistics.
  • ksdensity
    Kernel smoothing function estimate.
  • kurtosis
    Kurtosis of a data set.
  • mad
    Mean or median absolute deviation.
  • mean
    Mean of array elements.
  • median
    Median value of array elements.
  • mode
    Most frequent values.
  • moment
    Central moment of a data set.
  • nanmax
    Maximum, ignoring NaN values.
  • nanmean
    Mean, ignoring NaN values.
  • nanmedian
    Median, ignoring NaN values.
  • nanmin
    Minimum, ignoring NaN values.
  • nanstd
    Standard deviation, ignoring NaN values.
  • nansum
    Sum, ignoring NaN values.
  • nanvar
    Variance, ignoring NaN values.
  • prctile
    Percentiles of a data set.
  • probplot
    Probability plot.
  • qqplot
    Quantile-quantile plot.
  • quantile
    Quantiles of a data set.
  • range
    Range of values.
  • skewness
    Skewness of a data set.
  • std
    Standard deviation
  • tabulate
    Frequency table.
  • tdigest
    t-digest algorithm data structure for accurate quantile estimation with configurable compression parameters
  • tiedrank
    Ranks with average values for ties.
  • trimmean
    Mean after trimming extreme values.
  • var
    Variance
  • zscore
    Standardized z-scores.
Probability Distributions

Distribution functions for density, cumulative probability, inverse probability, fitting, likelihood, random sampling, and summary statistics.

  • betacdf
    Beta cumulative distribution function
  • betafit
    Beta parameter estimates
  • betainv
    Beta inverse cumulative distribution function
  • betalike
    Beta negative log-likelihood
  • betapdf
    Beta probability density function
  • betarnd
    Beta random numbers
  • betastat
    Beta mean and variance
  • binocdf
    Binomial cumulative distribution function
  • binofit
    Binomial probability estimate
  • binoinv
    Binomial inverse cumulative distribution function
  • binolike
    Binomial negative log-likelihood
  • binopdf
    Binomial probability density function
  • binornd
    Binomial random numbers
  • binostat
    Binomial mean and variance
  • chi2cdf
    Chi-square cumulative distribution function
  • chi2inv
    Chi-square inverse cumulative distribution function
  • chi2pdf
    Chi-square probability density function
  • chi2rnd
    Chi-square random numbers
  • chi2stat
    Chi-square mean and variance
  • evcdf
    Extreme value cumulative distribution function
  • evfit
    Extreme value parameter estimates
  • evinv
    Extreme value inverse cumulative distribution function
  • evlike
    Extreme value negative log-likelihood
  • evpdf
    Extreme value probability density function
  • evrnd
    Extreme value random numbers
  • evstat
    Extreme value mean and variance
  • expcdf
    Exponential cumulative distribution function
  • expfit
    Exponential mean estimate
  • expinv
    Exponential inverse cumulative distribution function
  • explike
    Exponential negative log-likelihood
  • exppdf
    Exponential probability density function
  • exprnd
    Exponential random numbers
  • expstat
    Exponential mean and variance
  • fcdf
    F cumulative distribution function
  • finv
    F inverse cumulative distribution function
  • fpdf
    F probability density function
  • frnd
    F random numbers
  • fstat
    F mean and variance
  • gamcdf
    Gamma cumulative distribution function
  • gamfit
    Gamma parameter estimates
  • gaminv
    Gamma inverse cumulative distribution function
  • gamlike
    Gamma negative log-likelihood
  • gampdf
    Gamma probability density function
  • gamrnd
    Gamma random numbers
  • gamstat
    Gamma mean and variance
  • geocdf
    Geometric cumulative distribution function
  • geofit
    Geometric probability estimate
  • geoinv
    Geometric inverse cumulative distribution function
  • geolike
    Geometric negative log-likelihood
  • geopdf
    Geometric probability density function
  • geornd
    Geometric random numbers
  • geostat
    Geometric mean and variance
  • gevcdf
    Generalized extreme value cumulative distribution function
  • gevfit
    Generalized extreme value parameter estimates
  • gevinv
    Generalized extreme value inverse cumulative distribution function
  • gevlike
    Generalized extreme value negative log-likelihood
  • gevpdf
    Generalized extreme value probability density function
  • gevrnd
    Generalized extreme value random numbers
  • gevstat
    Generalized extreme value mean and variance
  • logncdf
    Lognormal cumulative distribution function
  • lognfit
    Lognormal parameter estimates
  • logninv
    Lognormal inverse cumulative distribution function
  • lognlike
    Lognormal negative log-likelihood
  • lognpdf
    Lognormal probability density function
  • lognrnd
    Lognormal random numbers
  • lognstat
    Lognormal mean and variance
  • nbincdf
    Negative binomial cumulative distribution function
  • nbinfit
    Negative binomial parameter estimates
  • nbininv
    Negative binomial inverse cumulative distribution function
  • nbinlike
    Negative binomial negative log-likelihood
  • nbinpdf
    Negative binomial probability density function
  • nbinrnd
    Negative binomial random numbers
  • nbinstat
    Negative binomial mean and variance
  • normcdf
    Normal cumulative distribution function
  • normfit
    Normal mean and standard deviation estimates
  • norminv
    Normal inverse cumulative distribution function
  • normlike
    Normal negative log-likelihood
  • normpdf
    Normal probability density function
  • normrnd
    Normal random numbers
  • normstat
    Normal mean and variance
  • poisscdf
    Poisson cumulative distribution function
  • poissfit
    Poisson rate estimate
  • poissinv
    Poisson inverse cumulative distribution function
  • poisslike
    Poisson negative log-likelihood
  • poisspdf
    Poisson probability density function
  • poissrnd
    Poisson random numbers
  • poissstat
    Poisson mean and variance
  • randsample
    Random sample from a population.
  • raylcdf
    Rayleigh cumulative distribution function
  • raylfit
    Rayleigh scale estimate
  • raylinv
    Rayleigh inverse cumulative distribution function
  • rayllike
    Rayleigh negative log-likelihood
  • raylpdf
    Rayleigh probability density function
  • raylrnd
    Rayleigh random numbers
  • raylstat
    Rayleigh mean and variance
  • tcdf
    Student t cumulative distribution function
  • tinv
    Student t inverse cumulative distribution function
  • tpdf
    Student t probability density function
  • trnd
    Student t random numbers
  • tstat
    Student t mean and variance
  • unidcdf
    Discrete uniform cumulative distribution function
  • unidfit
    Discrete uniform maximum estimate
  • unidinv
    Discrete uniform inverse cumulative distribution function
  • unidlike
    Discrete uniform negative log-likelihood
  • unidpdf
    Discrete uniform probability density function
  • unidrnd
    Discrete uniform random numbers
  • unidstat
    Discrete uniform mean and variance
  • unifcdf
    Continuous uniform cumulative distribution function
  • unifinv
    Continuous uniform inverse cumulative distribution function
  • unifit
    Continuous uniform parameter estimates
  • uniflike
    Continuous uniform negative log-likelihood
  • unifpdf
    Continuous uniform probability density function
  • unifrnd
    Continuous uniform random numbers
  • unifstat
    Continuous uniform mean and variance
  • wblcdf
    Weibull cumulative distribution function
  • wblfit
    Weibull parameter estimates
  • wblinv
    Weibull inverse cumulative distribution function
  • wbllike
    Weibull negative log-likelihood
  • wblpdf
    Weibull probability density function
  • wblrnd
    Weibull random numbers
  • wblstat
    Weibull mean and variance
Hypothesis Tests

Statistical tests for distribution fit, location, variance, ranks, independence, and comparisons.

  • adtest
    Anderson-Darling goodness-of-fit test.
  • ansaribradley
    Ansari-Bradley test for equal dispersion.
  • chi2gof
    Chi-square goodness-of-fit test.
  • fishertest
    Fisher exact test for a 2-by-2 table.
  • friedman
    Friedman test for blocked data.
  • fsrftest
    Rank predictors using univariate regression F-tests.
  • jbtest
    Jarque-Bera normality test.
  • kruskalwallis
    Kruskal-Wallis one-way analysis of variance by ranks.
  • kstest
    One-sample Kolmogorov-Smirnov test
  • kstest2
    Two-sample Kolmogorov-Smirnov test
  • lillietest
    Lilliefors goodness-of-fit test.
  • ranksum
    Wilcoxon rank sum test.
  • runstest
    Runs test for randomness.
  • signrank
    Wilcoxon signed rank test.
  • signtest
    Sign test.
  • ttest
    One-sample and paired t-test
  • ttest2
    Two-sample t-test
  • vartest
    Chi-square test for a variance
  • vartest2
    F-test for equal variances
  • ztest
    Z-test for a mean with known standard deviation
ANOVA

Analysis of variance functions.

  • anova1
    One-way analysis of variance.
  • anova2
    Two-way analysis of variance.
Regression

Regression, correlation, and supervised prediction functions.

Classification

Classification model functions and helpers for grouped data.

Clustering and Anomaly Detection

Unsupervised learning, nearest-neighbor search, outlier handling, and sequence model functions.

  • cluster
    Construct clusters from a hierarchical cluster tree.
  • clusterdata
    Cluster observations from data.
  • dbscan
    Density-based spatial clustering.
  • dendrogram
    Dendrogram plot for a hierarchical cluster tree.
  • evalclusters
    Evaluate clustering solutions.
  • filloutliers
    Detect and replace outliers in numeric data.
  • fitgmdist
    Fit a Gaussian mixture distribution.
  • gmdistribution
    Gaussian mixture distribution.
  • grpstats
    Summary statistics organized by group.
  • hmmdecode
    Posterior state probabilities for a discrete hidden Markov model.
  • hmmestimate
    Estimate discrete hidden Markov probabilities from known states.
  • hmmgenerate
    Generate a discrete hidden Markov sequence.
  • hmmtrain
    Train a discrete hidden Markov model.
  • hmmviterbi
    Most likely state path for a discrete hidden Markov model.
  • isoutlier
    Find outliers in numeric data.
  • kmeans
    k-means clustering.
  • kmedoids
    Partition data into clusters using medoids.
  • knnsearch
    Find k-nearest neighbors.
  • linkage
    Agglomerative hierarchical cluster tree.
  • mahal
    Squared Mahalanobis distance to reference samples.
  • pdist
    Pairwise distances between observations.
  • pdist2
    Pairwise distances between two sets of observations.
  • rangesearch
    Find all neighbors within a specified distance.
  • rmoutliers
    Detect and remove outliers from numeric data.
  • silhouette
    Silhouette values for clustered data.
  • spectralcluster
    Spectral clustering.
  • squareform
    Convert between condensed distance vector and square distance matrix.
Dimensionality Reduction and Feature Selection

Functions for dimensionality reduction, factor analysis, feature ranking, and low-rank representations.

  • cmdscale
    Classical multidimensional scaling.
  • factoran
    Factor analysis.
  • mdscale
    Nonclassical multidimensional scaling.
  • nnmf
    Nonnegative matrix factorization.
  • pca
    Principal component analysis of raw data.
  • pcacov
    Principal component analysis on a covariance matrix.
  • pcares
    Residuals from principal component analysis.
  • ppca
    Probabilistic principal component analysis.
  • relieff
    Rank predictor importance using ReliefF.
  • rotatefactors
    Rotate factor loadings.
  • sequentialfs
    Sequential feature selection using a custom criterion.
Design of Experiments

Functions for experimental design and model configuration.

  • candexch
    D-optimal row selection from a candidate set.
  • candgen
    Generate a candidate set for designs.
  • cordexch
    D-optimal design using coordinate-style interface.
  • daugment
    Augment a D-optimal design.
  • rowexch
    D-optimal design using row exchange.
  • statget
    Access field values in statistics options structures.
  • statset
    Create or update statistics options structures.
  • x2fx
    Convert factor settings to a design matrix.
Data analysis

The Data Analysis module provides tools for performing numerical and array-based analyses in Nelson.

It supports cumulative operations, sorting, aggregation, convolution, and identification of unique or missing values.

This module supports processing, summarization, and exploration of datasets for computational and analytical tasks.

ODE solvers

The ODE Solvers module provides time integration functions for explicit, stiff, and implicit differential equation workflows in Nelson.

It includes solver entry points, delay and boundary value problem wrappers, option handling, interpolation, solution extension, event detection, and object-oriented problem definitions.

When the optional SUNDIALS backend is built, the object workflow can also select CVODES and IDAS solver values.

The module is designed for numerical experiments, simulations, and teaching examples that need compact solver setup and reproducible result objects.

Tutorial pages cover solver choice, events, tolerances, mass matrices, implicit equations, delay equations, boundary value problems, interpolation, extension, object workflows, and complex states.

Area Main entries
Initial value problems ode23, ode45, ode78, ode89, ode113, ode15s, ode15i
Delay and boundary value problems dde23, ddesd, ddensd, bvp4c, bvp5c
Utilities odeset, deval, odextend, ode, odeEvent, odeSensitivity
Polynomials

The Polynomials module provides tools for creating, manipulating, and analyzing polynomials in Nelson.

It supports polynomial evaluation, differentiation, integration, fitting, root finding, and matrix polynomial operations.

This module enables efficient handling of polynomial expressions for mathematical modeling, curve fitting, and numerical analysis.

Geometry

The Geometry module provides tools for performing geometric transformations and computations in Nelson.

It supports rotation operations in three-dimensional space, convex hulls, Delaunay triangulations, Voronoi diagrams, spatial searches, and scattered data interpolation.

This module is useful for applications in computer graphics, robotics, computational geometry, interpolation, and spatial analysis.

Control System functions

The Control System module provides algorithms and tools for designing, analyzing, and tuning linear control systems in Nelson.

It supports state-space and transfer function models, system transformations between continuous and discrete time, and computation of poles, zeros, and frequency responses.

The module also includes system balancing, controllability and observability analysis, regulator and estimator design, and simulation of dynamic responses.

These tools are used to model, analyze, and control linear dynamic systems in engineering and research code.

Dynamic System Models

Functions for creating, inspecting, and reducing dynamic system models.

  • balreal
    Gramian-based balancing of state-space realizations.
  • isct
    Checks if dynamic system model is in continuous time.
  • isdt
    Checks if dynamic system model is in discrete time.
  • islti
    Checks if variable is an linear model tf, ss or zpk.
  • issiso
    Checks if dynamic system model is single input and single output.
  • isstatic
    Checks if model is static or dynamic.
  • minreal
    Minimal realization or pole-zero cancellation.
  • pole
    Poles of dynamic system.
  • ss
    State-space model.
  • ssdata
    Access state-space model data.
  • tf
    Constructs a transfer function model.
  • tfdata
    Access transfer function model data.
  • tzero
    Invariant zeros of linear system.
  • zero
    Zeros and gain of SISO dynamic system.
Model Conversion and Interconnection

Functions for model conversion, composition, selection, and interconnection.

  • abcdchk
    Verifies the dimensional compatibility of matrices A, B, C, and D.
  • append
    Appends the inputs and outputs of the two models.
  • augstate
    Append state vector to output vector.
  • c2d
    Convert model from continuous to discrete time.
  • d2c
    Convert model from discrete to continuous time.
  • feedback
    Feedback connection of multiple models.
  • gensig
    Create periodic signals for simulating system response.
  • padecoef
    Computes the Pade approximation of time delays.
  • parallel
    Parallel connection of two models.
  • series
    Series connection of two models.
  • ss2tf
    Convert state-space representation to transfer function.
  • ssdelete
    Remove inputs, outputs and states from state-space system.
  • ssselect
    Extract subsystem from larger system.
  • tf2ss
    Convert transfer function filter parameters to state-space form.
Linear Analysis

Functions for time-domain, frequency-domain, and model-response analysis.

  • bode
    Bode plot of frequency response, magnitude and phase data.
  • damp
    Natural frequency and damping ratio.
  • dcgain
    Low-frequency (DC) gain of LTI system.
  • evalfr
    Evaluate frequency response at given frequency.
  • freqresp
    Evaluate system response over a grid of frequencies.
  • hsvd
    Hankel singular values of dynamic system.
  • nyquist
    Nyquist plot of frequency response.
  • sigma
    Singular value response of an LTI model.
Time and Frequency Responses

Simulation and response functions for dynamic systems.

  • impulse
    Impulse response plot of dynamic system.
  • initial
    System response to initial states of state-space model.
  • lsim
    Plot simulated time response of dynamic system to arbitrary inputs.
  • step
    Step response plot of dynamic system.
Control Design and Tuning

Functions for controller design, estimators, and regulator computations.

  • acker
    Pole placement gain selection using Ackermann's formula.
  • are
    Algebraic Riccati equation solution.
  • care
    Continuous-time algebraic Riccati equation solution.
  • dare
    Discrete-time algebraic Riccati equation solution.
  • dlqr
    Linear-quadratic (LQ) state-feedback regulator for discrete-time state-space system.
  • kalman
    Design Kalman filter for state estimation.
  • lqe
    Kalman estimator design for continuous-time systems.
  • lqed
    Calculates the discrete Kalman estimator configuration based on a continuous cost function.
  • lqr
    Linear-Quadratic Regulator (LQR) design.
  • lqry
    Form linear-quadratic (LQ) state-feedback regulator with output weighting.
  • ord2
    Generate continuous second-order systems.
Matrix Computations

Control-oriented matrix computations for state-space analysis.

  • bdschur
    Block-diagonal Schur factorization.
  • cloop
    Feedback connection of multiple models.
  • compreal
    Companion realization of transfer functions.
  • ctrb
    Controllability of state-space model.
  • ctrbf
    Compute controllability staircase form.
  • dlyap
    Discrete-time Lyapunov equations.
  • dsort
    Sort discrete-time poles by magnitude.
  • esort
    Sort continuous-time poles by real part.
  • gram
    Controllability and observability Gramians.
  • lyap
    Continuous Lyapunov equation solution.
  • obsv
    Observability of state-space model.
  • obsvf
    Compute observability staircase form.
  • schord
    Order a Schur decomposition.
Subroutine Library In COntrol Theory

The SLICOT module provides advanced numerical algorithms for computations in systems and control theory.

It includes tools for matrix factorization, system balancing, stability analysis, pole assignment, and solutions of Lyapunov, Riccati, and Sylvester equations.

The module supports both continuous- and discrete-time systems, including descriptor and multi-input systems, enabling precise and efficient analysis, design, and control of complex dynamic systems.

Signal Processing

The Signal Processing module provides tools for analyzing, filtering, transforming, and resampling sampled signals in Nelson.

It includes windowing functions, FIR and IIR filter design, digital filtering, zero-pole and second-order-section conversions, cross-correlation, and conversions between magnitude, power, and decibel representations.

The module also supports multirate processing, spectral estimation, time-frequency analysis, waveform generation, and common signal measurements.

Signal Generation and Preprocessing

Functions for creating, resampling, smoothing, filtering, and preparing signals.

  • chirp
    Swept-frequency cosine signal.
  • decimate
    Lowpass filter and downsample a vector.
  • downsample
    Downsample a signal by an integer factor.
  • filter2
    2-D digital filter.
  • hampel
    Hampel outlier filtering.
  • interp
    Interpolate a vector by an integer factor.
  • medfilt1
    One-dimensional median filter.
  • rectpuls
    Sampled rectangular pulse.
  • resample
    Change sample rate by a rational factor.
  • sawtooth
    Sawtooth or triangle waveform.
  • sgolay
    Savitzky-Golay filter coefficients.
  • sgolayfilt
    Savitzky-Golay smoothing filter.
  • sinc
    Sinc function.
  • square
    Square waveform.
  • tripuls
    Sampled triangular pulse.
  • upfirdn
    Upsample, FIR filter, and downsample.
  • upsample
    Upsample a sequence by an integer factor.
Measurements and Feature Extraction

Signal measurements, features, and quality metrics.

  • bandpower
    Estimate signal power in a frequency band.
  • findpeaks
    Locate local maxima (peaks) in a 1-D signal.
  • meanfreq
    Mean frequency of a signal spectrum.
  • medfreq
    Median frequency of a signal spectrum.
  • peak2peak
    Difference between maximum and minimum values.
  • rms
    Root mean square value.
  • snr
    Signal-to-noise ratio.
  • thd
    Total harmonic distortion estimate.
Transforms, Correlation, and Modeling

Transforms, correlation estimates, coherence, and transfer-function estimates.

  • cconv
    Circular convolution.
  • cpsd
    Cross power spectral density estimate.
  • dct
    Discrete cosine transform.
  • hilbert
    Analytic signal using the Hilbert transform.
  • idct
    Inverse discrete cosine transform.
  • mscohere
    Magnitude-squared coherence estimate.
  • tfe
    Transfer function estimate compatibility wrapper.
  • tfestimate
    Transfer function estimate.
  • xcorr
    Cross-correlation of discrete-time signals.
  • xcorr2
    2-D cross-correlation.
  • xcov
    Cross-covariance of discrete-time signals.
Digital Filters

Filter design, analysis, conversion, and implementation functions.

  • butter
    Butterworth digital filter design.
  • buttord
    Minimum order for a Butterworth filter.
  • cheb1ord
    Minimum order for a Chebyshev type I filter.
  • cheb2ord
    Minimum order for a Chebyshev type II filter.
  • cheby1
    Chebyshev type I digital filter design.
  • cheby2
    Chebyshev type II digital filter design.
  • ellip
    Elliptic digital filter design.
  • ellipord
    Minimum order for an elliptic filter.
  • fftfilt
    FIR filtering helper.
  • filtfilt
    Forward and reverse digital filtering.
  • filtic
    Initial conditions for digital filtering.
  • filtord
    Digital filter order.
  • fir1
    Window-based FIR filter design.
  • fir2
    Frequency sampling FIR filter design.
  • freqz
    Frequency response of a digital filter.
  • grpdelay
    Group delay of a digital filter.
  • impz
    Impulse response of a digital filter.
  • impzlength
    Length estimate for an impulse response.
  • isfir
    Determine whether a digital filter is FIR.
  • isstable
    Determine whether a digital filter is stable.
  • phasez
    Phase response of a digital filter.
  • sos2tf
    Convert second-order sections to transfer function coefficients.
  • sos2zp
    Convert second-order sections to zero-pole-gain form.
  • sosfilt
    Filter data with second-order sections.
  • stepz
    Step response of a digital filter.
  • tf2sos
    Convert transfer function coefficients to second-order sections.
  • tf2zp
    Convert transfer function coefficients to zero-pole-gain form.
  • zp2sos
    Convert zero-pole-gain form to second-order sections.
  • zp2tf
    Zero-pole to transfer function conversion.
Spectral Analysis

Power spectrum, window, and scale-conversion functions.

Time-Frequency Analysis

Short-time and time-frequency representation functions.

  • istft
    Inverse short-time Fourier transform.
  • spectrogram
    Spectrogram using short-time Fourier transforms.
  • stft
    Short-time Fourier transform.
FFTW

The FFTW module provides tools for computing fast Fourier transforms in Nelson.

It supports one-dimensional, two-dimensional, and multidimensional transforms, as well as inverse transforms and frequency-domain manipulations.

The module enables efficient spectral analysis and signal processing, leveraging high-performance algorithms for both real and complex data.

Random

The Random module provides tools for generating random numbers and random sequences in Nelson.

It supports uniform and normal distributions, random integer generation, permutations, and control over the random number generator state.

This module is essential for simulations, probabilistic modeling, and stochastic computations.

OS functions

The OS Functions module provides tools for interacting with the operating system in Nelson.

It includes functions for querying system information, managing environment variables, executing shell commands, generating GUIDs, and performing platform-specific operations.

This module lets Nelson scripts interact with the operating system on Windows, macOS, and Linux/Unix platforms.

Files and folders functions

The File and Folder Functions module provides tools for managing files, directories, and paths in Nelson.

This module supports navigation of the file system, creation and removal of files and directories, querying file and folder properties, building and resolving paths, and handling platform-specific separators.

This module enables efficient and cross-platform file system operations within Nelson scripts and applications.

File archiver functions

The File Archiver module provides tools for compressing and decompressing files in Nelson.

It supports creation of zip archives and extraction of files from zip archives, enabling efficient file storage, sharing, and management.

Memory manager functions

The Memory Manager module provides tools for managing variables and memory in Nelson.

It supports variable creation, assignment, querying, and removal across different scopes, as well as handling global and persistent variables.

The module also supports memory inspection, variable locking, and listing of workspace contents for controlled memory usage in scripts and applications.

Date and Time

The Time Functions module provides tools for working with dates, times, and durations in Nelson.

It supports querying the current time, measuring elapsed time, performing calculations on dates and times, converting between different time representations, and handling calendar-specific operations such as leap years and month-end calculations.

This module enables precise time management, scheduling, and performance measurement in scripts and applications.

Create Date and Time Arrays

Functions for creating date and time values and alternate date representations.

  • NaT
    Create not-a-time datetime values.
  • calendar
    Calendar.
  • clock
    Return the current local date and time as a date vector.
  • date
    Return the Current date as character vector.
  • datenum
    Return the date/time input as a serial day number.
  • datetime
    Create datetime arrays from calendar parts, text, or numeric date representations.
  • datevec
    Convert a serial date number into a date vector.
  • eomdate
    Return the serial date number of the last day in a month.
  • eomday
    Returns last day of month.
  • lweekdate
    Return the last selected weekday in a month.
  • now
    Returns current date under the form of a Unix hour.
  • nweekdate
    Return the nth selected weekday in a month.
  • today
    Return the serial date number for the current day.
Duration and Calendar Duration

Functions for fixed-length and calendar-based durations.

  • caldays
    Create calendar durations containing whole days.
  • calendarDuration
    Create calendar durations with month, day, and time components.
  • calmonths
    Create calendar durations containing calendar months.
  • calquarters
    Create calendar durations containing calendar quarters.
  • calweeks
    Create calendar durations containing whole weeks.
  • calyears
    Create calendar durations containing calendar years.
  • days
    Create durations from days or convert durations to days.
  • duration
    Create elapsed time durations.
  • hours
    Create durations from hours or convert durations to hours.
  • milliseconds
    Create durations from milliseconds or convert durations to milliseconds.
  • minutes
    Create durations from minutes or convert durations to minutes.
  • seconds
    Create durations from seconds or extract seconds from durations.
  • years
    Create durations from years or convert durations to years.
Date and Time Components

Functions for extracting and splitting date and time components.

  • day
    Extract day information from date and time values.
  • hms
    Split datetime or duration values into hour, minute, and second components.
  • hour
    Hours part of the input date and time.
  • minute
    Minutes part of the input date and time.
  • month
    Extract month numbers or names from date and time values.
  • quarter
    Extract quarter numbers from date and time values.
  • second
    Seconds part of the input date and time.
  • timeofday
    Return the elapsed time since midnight for datetime values.
  • week
    Compute week numbers within the calendar year.
  • weekday
    Return the day of week.
  • weeknum
    Return week numbers within the calendar year.
  • year
    Extract year numbers from date and time values.
  • ymd
    Split datetime values into year, month, and day components.
Date Arithmetic and Ranges

Functions for date shifts, differences, ranges, and elapsed time.

  • addtodate
    Modify date number by field.
  • between
    Return calendar durations between two datetime values.
  • caldiff
    Return calendar differences between adjacent datetime values.
  • dateshift
    Shift datetime values to calendar boundaries or selected weekdays.
  • etime
    Time elapsed between date vectors.
  • isbetween
    Test whether datetime values lie inside an interval.
  • months
    Return whole calendar months between two dates.
Query Date and Time Arrays

Predicates and query functions for date, time, duration, and timezone data.

  • iscalendarduration
    Test whether an input is a calendarDuration array.
  • isdatetime
    Test whether an input is a datetime array.
  • isdst
    Test whether timezone-aware datetime values are in daylight saving time.
  • isduration
    Test whether an input is a duration array.
  • isnat
    Test datetime values for not-a-time elements.
  • isregular
    Test whether datetime values are regularly spaced.
  • istimeseries
    Determine whether input is a timeseries object.
  • isweekend
    Test whether date values fall on Saturday or Sunday.
  • leapseconds
    Return leap second data available to the time module.
  • leapyear
    Determine leap year.
  • timezones
    List timezone names available in the embedded timezone data.
  • tzoffset
    Return UTC offsets for timezone-aware datetime values.
Text and External Time Systems

Conversions between date and time values, text, and external numeric time systems.

  • convertTo
    Convert datetime values to selected numeric representations.
  • datestr
    Convert date and time to string format.
  • exceltime
    Convert datetime values to spreadsheet serial date numbers.
  • juliandate
    Convert datetime values to Julian date numbers.
  • m2xdate
    Convert Nelson serial dates to spreadsheet serial date numbers.
  • posixtime
    Convert datetime values to seconds elapsed since the POSIX epoch.
  • x2mdate
    Convert spreadsheet serial date numbers to Nelson serial dates or datetime values.
  • yyyymmdd
    Convert date values to numeric yyyymmdd calendar dates.
Timers and Timing

Timer objects, scheduling, waits, and timing utilities.

  • cputime
    Return the CPU time used by your Nelon session.
  • sleep
    Suspend code execution.
  • start
    Start a timer object.
  • timer.start
    Start a timer object.
  • startat
    Start a timer at a specified date and time.
  • timer.startat
    Start a timer at a specified date and time.
  • stop
    Stop a running timer object.
  • timer.stop
    Stop a running timer object.
  • tic
    Starts a stopwatch timer.
  • time
    Return the current time as the number of seconds or nanoseconds since the epoch.
  • timeit
    Measure time required to run function.
  • timer.delete
    Stop and invalidate timer objects.
  • delete timer
    Stop and invalidate timer objects.
  • timer.get
    Get timer property values.
  • get timer
    Get timer property values.
  • timer.isvalid
    Determine which timer handles are valid.
  • isvalid timer
    Determine which timer handles are valid.
  • timer.set
    Set timer property values.
  • set timer
    Set timer property values.
  • timer
    Create a timer object that runs commands after a delay or at repeated intervals.
  • timer object
    Create a timer object that runs commands after a delay or at repeated intervals.
  • Timer Callback Functions
    Define commands that execute when timer events occur.
  • timer callback functions
    Define commands that execute when timer events occur.
  • timer callbacks
    Define commands that execute when timer events occur.
  • Timer Queuing Conflicts
    Control what happens when timer callbacks are still queued when a fixed-rate timer fires again.
  • handling timer queuing conflicts
    Control what happens when timer callbacks are still queued when a fixed-rate timer fires again.
  • timer busy mode
    Control what happens when timer callbacks are still queued when a fixed-rate timer fires again.
  • timerfind
    Find visible timer objects that match property criteria.
  • timerfindall
    Find all timer objects that match property criteria, including hidden timers.
  • toc
    Read the stopwatch timer.
  • wait
    Wait for timer objects to stop.
  • timer.wait
    Wait for timer objects to stop.
Time Series

Time series, time series collections, events, metadata, and related operations.

Stream manager

The Stream Manager module provides tools for managing input and output streams in Nelson.

It supports reading and writing text and binary data to files, handling file positions, detecting end-of-file conditions, and managing file errors.

The module also supports session logging and workspace load/save operations for controlled file I/O in scripts and applications.

HDF5

The HDF5 module provides support for working with Hierarchical Data Format (HDF5) files in Nelson.

It creates datasets, reads and writes data and attributes, and inspects file contents.

In addition to standard HDF5 support, it includes utilities for Nelson's native .nh5 format, enabling users to save, load, and inspect workspace variables efficiently.

This module is essential for managing large, structured, and portable scientific data.

netCDF
MATIO

The MATIO module reads and writes MAT-files, a format used by several numerical computing environments for storing numerical data.

It enables Nelson to check MAT-file validity, load and save workspace variables, and inspect file contents.

This module supports data exchange between Nelson and MAT-file-compatible environments in scientific and engineering workflows.

Xml Processing

The XML module provides functions to create, convert, and manage XML documents for Nelson.

JavaScript Object Notation

The JSON module provides functions to encode, decode, and format JSON data, allowing easy exchange of structured information between Nelson and external systems.

JSON (JavaScript Object Notation) is a lightweight, text-based data format widely used for transmitting attribute-value pairs and arrays.

This module enables Nelson to interoperate with web services, configuration files, and applications that rely on JSON.

AI and MCP integration.
Parquet

The Parquet module provides local file support for Apache Parquet data sets.

It reads and writes column-oriented tables, exposes file metadata, and provides datastore and row-filter helpers for workflows that process one or more Parquet files.

Supported table variables include logical values, integer types, single and double precision floating point values, text, datetime values, duration values, nested tables stored as struct columns, and homogeneous primitive cell vectors stored as list columns.

Spreadsheet

The Spreadsheet module provides functions for reading and writing tabular data from and to text-based spreadsheet formats, such as CSV and delimiter-separated files.

It supports importing into various data types like numeric arrays, cell arrays, and tables, as well as exporting them back to files.

This enables smooth interaction with spreadsheet software (Excel, LibreOffice Calc, etc.) and data exchange between applications.

Message Passing Interface

In the world of parallel computing, the Message Passing Interface (MPI) is the de facto standard for implementing programs on multiple processors.

This module provides functions to initialize, manage, and finalize MPI environments, as well as to perform communication between processes, both point-to-point and collective.

It enables Nelson programs to run efficiently on distributed-memory systems and clusters.

Note: MPI support is not available on Windows on ARM64 (woa64) architecture.

Parallel

The parallel module provides tools for running computations asynchronously in the background, managing task scheduling, and retrieving results.

It enables Nelson programs to execute functions concurrently, improving efficiency and responsiveness by offloading work to background workers.

Inter Process Communication

The ipc module provides basic tools for interacting with processes and enabling communication between them.

It allows retrieving process identifiers and using a communicator object for exchanging information across Nelson processes.

Audio playback functions

The audio module provides functions for reading, writing, analyzing, and playing audio files.

It supports playback control through the audioplayer object, manipulation of playback properties, and metadata handling.

It also includes utilities for signal conversion and sound generation.

History manager

The History Manager module in Nelson provides tools to access and manage the command history of your session.

It records previously executed commands, recalls them for reuse, and keeps command history organized.

Gui module

The GUI module provides functions to create and interact with graphical user interface components, dialogs, and application windows.

QML engine

The QML Engine module allows Nelson programs to display, manipulate, and interact with graphical content using Qt's QML framework.

It provides functions to manage QML components, access Qt objects, and integrate JavaScript and QML logic.

Text editor

The Text Editor module provides an embedded Nelson editor for creating, editing, and formatting Nelson scripts and files.

Graphics functions

The graphics module provides functions for creating, customizing, and managing plots, figures, colormaps, and graphical objects.

It includes 2-D and 3-D visualization, user interaction tools (zoom, pan, rotate), and utilities for working with colors, legends, axes, and text annotations.

2-D and 3-D Plots

Functions grouped by visualization type, including lines, distributions, discrete data, polar plots, contours, vector fields, surfaces, volumes, polygons, and animation.

Line Plots

Functions for line plots, function plots, and plots with error bars.

  • errorbar
    Plot data with error bars.
  • fplot
    Plot an expression or parametric function.
  • fplot3
    Plot a 3-D parametric curve from function handles.
  • line
    Create primitive line.
  • loglog
    Log-log scale plot.
  • plot
    Linear 2-D plot.
  • plot3
    3-D line plot.
  • semilogx
    Semilog plot (x-axis has log scale).
  • semilogy
    Semilog plot (y-axis has log scale).
  • xline
    Vertical constant line.
  • yline
    Horizontal constant line.
Polar Plots

Functions for creating and configuring polar plots.

Contour Plots

Functions for contour computation, contour plots, and contour labels.

Data Distribution Plots

Functions for histograms, scatter plots, distribution charts, and data summary visualizations.

Vector Fields

Functions for vector fields and stream visualizations.

  • compass
    Display arrows from the origin on a polar grid.
  • compassplot
    Display vectors from the origin in polar coordinates.
  • coneplot
    Display 3-D vector directions with cone-style arrows.
  • feather
    Display vectors from a baseline.
  • quiver
    2-D vector field plot.
  • quiver3
    3-D vector field plot.
  • stream2
    Compute 2-D streamline vertices from vector field data.
  • stream3
    Compute 3-D streamline vertices from vector field data.
  • streamline
    Display streamlines from vector field data.
  • streamparticles
    Display particle markers along stream paths.
  • streamribbon
    Display stream paths with ribbon-like line styling.
  • streamslice
    Display vector field direction on a slice or plane.
  • streamtube
    Display stream paths with tube-like line styling.
Discrete Data Plots

Functions for bar charts, stem plots, pie charts, and other discrete data displays.

  • bar
    Bar graph.
  • bar3
    Display a 3-D vertical bar chart.
  • bar3h
    Display a 3-D horizontal bar chart.
  • barh
    Horizontal bar graph.
  • donutchart
    Donut chart object.
  • pareto
    Display Pareto chart.
  • pie
    Legacy pie chart.
  • piechart
    Pie chart object.
  • stairs
    Stairstep graph.
  • stem
    Plot discrete sequence data.
  • stem3
    Display 3-D stem plot.
Surfaces, Volumes, and Polygons

Functions for surfaces, meshes, volumes, filled areas, and polygon graphics.

  • area
    Create area plots.
  • contourslice
    Display contour lines on slices through volume data.
  • cylinder
    Create cylinder.
  • fill
    Create filled 2-D patches.
  • fill3
    Create filled 3-D patches.
  • fimplicit
    Plot an implicit function curve.
  • fimplicit3
    Plot an implicit 3-D function surface approximation.
  • fmesh
    Plot a mesh from a function of two variables.
  • fsurf
    Plot a function surface.
  • isonormals
    Compute normals of isosurface vertices.
  • isosurface
    Extract isosurface data from volume data.
  • mesh
    Mesh surface plot.
  • meshc
    Display a mesh with contour lines below it.
  • meshz
    Mesh surface plot with curtain.
  • patch
    Create patches of colored polygons
  • pcolor
    Pseudocolor plot.
  • rectangle
    Create a rectangle with sharp, rounded or curved corners
  • ribbon
    Ribbon plot.
  • shrinkfaces
    Reduce patch face size.
  • slice
    Display orthogonal slices through volume data.
  • smooth3
    Smooth 3-D data.
  • sphere
    Create sphere.
  • surf
    surface plot.
  • surface
    Primitive surface plot.
  • surfc
    Display a surface with contour lines below it.
  • surfl
    Display a lighted surface.
  • surfnorm
    Compute or display surface normal vectors.
  • triplot
    2-D triangular plot
  • trisurf
    Triangular surface plot
  • waterfall
    waterfall plot.
Animation

Functions for animated plots and dynamic point updates.

    Graphics Objects

    Functions and reference pages for graphics object management, layout objects, user interface objects, and object properties.

    Graphics Object Management

    Functions for creating, finding, querying, clearing, and closing graphics objects.

    • allchild
      Return all direct children of graphics objects.
    • ancestor
      Ancestor of graphics object.
    • axes
      Create cartesian axes.
    • cla
      Clear axes.
    • clf
      Clear figure.
    • close
      Close one or more figures
    • figure
      Creates an figure window.
    • findall
      Find graphics objects, including hidden handles.
    • findobj
      Find graphics objects with specific properties.
    • gca
      get current axes graphics object.
    • gcf
      get current figure graphics object.
    • groot
      graphic root object.
    • hggroup
      Create group object.
    • hold
      Retain current plot when adding new plots.
    • is2D
      Checks if ax is a 2-D Polar or Cartesian axes.
    • isValidGraphicsProperty
      Check property name is valid.
    • isgraphics
      Check for graphics object.
    • ishold
      Get current hold state.
    • newplot
      Prepare to produce a new plot.
    Layout Objects

    Functions for arranging multiple plots and working with tiled layouts.

    • nexttile
      Create axes in tiled chart layout.
    • subplot
      Create axes in tiled positions.
    • tiledlayout
      Create tiled chart layout.
    • tilenum
      Get tile number from row-column indices or graphics object.
    • tilerowcol
      Get row and column indices from tile number or graphics object.
    User Interface Objects

    Functions for user interface controls, menus, and context menus.

    Graphics Object Properties

    Reference pages for visible graphics object properties, supported value types, and property actions.

      Labels and Styling

      Functions for labels, annotations, axes appearance, colors, interaction, camera views, and lighting.

      Axes Appearance

      Functions for axis limits, ticks, grids, boxes, and aspect ratios.

      • axis
        Set axis limits and aspect ratios.
      • box
        Display or hide graphics object outline.
      • daspect
        Control data unit length along each axis.
      • datetick
        Date formatted tick labels.
      • grid
        Display or hide axes grid lines.
      • pbaspect
        Control relative lengths of each axis in the plot box.
      • rlim
        Set or get radial limits for polar axes.
      • rticklabels
        Set or get radial tick labels for polar axes.
      • rticks
        Set or get radial tick values for polar axes.
      • thetalim
        Set or get angular limits for polar axes.
      • thetaticklabels
        Set or get angular tick labels for polar axes.
      • thetaticks
        Set or get angular tick values for polar axes.
      • xlim
        set or get x-axis limits.
      • xtickangle
        Rotate x-axis tick labels.
      • xtickformat
        Set or get the x-axis tick label format.
      • xticklabels
        Set or get x-axis tick labels.
      • xticks
        Set or get x-axis tick values.
      • ylim
        set or get y-axis limits.
      • ytickangle
        Rotate y-axis tick labels.
      • ytickformat
        Set or get the y-axis tick label format.
      • yticklabels
        Set or query y-axis tick labels.
      • yticks
        Set or get y-axis tick values.
      • yyaxis
        Create or select an axes with two y-axes.
      • zlim
        set or get z-axis limits.
      • ztickangle
        Rotate z-axis tick labels.
      • ztickformat
        Set or get the z-axis tick label format.
      • zticklabels
        Set or get z-axis tick labels.
      • zticks
        Set or get z-axis tick values.
      Color and Styling

      Functions for colors, colormaps, color limits, color order, and rendering style.

      Colormaps

      Functions for creating, selecting, and listing colormaps.

      • abyss
        Abyss colormap array.
      • autumn
        Autumn colormap array.
      • bone
        Bone colormap array.
      • colorcube
        Enhanced RGB color cube colormap array.
      • colormap
        View and set current colormap.
      • colormaplist
        Provide list of colormaps.
      • cool
        Cool colormap array.
      • copper
        Copper colormap array.
      • flag
        Flag colormap array.
      • gray
        Gray colormap array.
      • hot
        Hot colormap array.
      • hsv
        Hue-saturation-value colormap array.
      • jet
        Jet colormap array.
      • lines
        Line color order colormap array.
      • nebula
        Nebula colormap array.
      • parula
        Parula colormap array.
      • pink
        Pink colormap array.
      • prism
        Prism colormap array.
      • sky
        Sky colormap array.
      • spring
        Spring colormap array.
      • summer
        Summer colormap array.
      • turbo
        Turbo colormap array.
      • viridis
        Viridis colormap array.
      • white
        white colormap array.
      • winter
        Winter colormap array.
      Interactions, Camera Views, and Lighting

      Functions for interactive graphics, callbacks, camera views, and lighting.

      Labels and Annotations

      Functions for titles, axis labels, legends, color bars, text, and annotations.

      • caxis
        Query or set axes color limits.
      Images

      Functions for displaying images, converting frames, and playing recorded frames.

      • frame2im
        Retrieve image data from a movie frame.
      • getframe
        Capture figure or axes as movie frame.
      • im2frame
        Convert image to movie frame.
      • image
        Display image from array.
      • imagesc
        Display image from array with scaled colors.
      • imshow
        Display image.
      • movie
        Render recorded movie frames.
      Printing and Saving

      Functions for opening and saving figure files.

      • openfig
        Open a Nelson FIG file.
      • print
        Export a figure to an image or document file.
      • savefig
        Save figure to a Nelson FIG file.
      Graphics I/O functions

      The Graphics I/O module provides functions for importing, exporting, and managing graphical content and image formats.

      It supports reading and writing image files, copying figures, and saving plots in various file formats for interoperability with other applications.

      Image Processing functions

      The Image Processing module provides operations for manipulating images and volumes, including type conversion, color conversion, contrast adjustment, filtering, morphology, connected components, region measurements, geometric transforms, resizing, rotation, feature detection, foundational 3-D processing, and image registration.

      Help pages are grouped into topic chapters: image basics, image analysis and segmentation, and geometry, registration, and 3-D processing.

      Image Basics

      Functions for image classes, color spaces, contrast adjustment, thresholding, filtering, padding, and edge detection.

      Image Types and Color

      Functions for image type conversion, color space conversion, and indexed image conversion.

      • hsv2rgb
        Convert HSV color values to RGB color values.
      • im2double
        Convert image to double precision.
      • im2gray
        Convert RGB image to grayscale and pass grayscale images through.
      • im2single
        Convert image to single precision.
      • im2uint16
        Convert image to 16-bit unsigned integer.
      • im2uint8
        Convert image to 8-bit unsigned integer.
      • ind2gray
        Convert indexed image to grayscale using a colormap.
      • ind2rgb
        Convert indexed image to RGB using a colormap.
      • rgb2gray
        Convert RGB image to grayscale.
      • rgb2hsv
        Convert RGB color values to HSV color values.
      • rgb2ind
        Convert RGB image to indexed image.
      • rgb2ycbcr
        Convert RGB color values to YCbCr color values.
      • ycbcr2rgb
        Convert YCbCr color values to RGB color values.
      Contrast and Thresholding

      Functions for contrast adjustment, threshold selection, histogram analysis, and binary image creation.

      Filtering and Edges

      Functions for spatial filtering, Gaussian and median filtering, padding, filter kernels, and edge detection.

      • edge
        Find edges in a grayscale image.
      • fspecial
        Create predefined 2-D image filters.
      • imboxfilt
        Apply box filtering to an image.
      • imfilter
        Filter an image with a 2-D kernel.
      • imgaussfilt
        Apply Gaussian filtering to an image.
      • medfilt2
        Apply 2-D median filtering.
      • padarray
        Pad an array before image filtering or morphology.
        Image Analysis and Segmentation

        Functions for morphology, connected components, boundary tracing, region measurements, reconstruction, and segmentation.

        Morphology

        Functions for binary and grayscale morphological operations, object cleanup, border cleanup, and structuring elements.

        • bwareaopen
          Remove small connected components from a binary image.
        • bwmorph
          Apply morphological operations to binary images.
        • bwperim
          Find perimeter pixels of binary objects.
        • imbothat
          Bottom-hat filtering of an image.
        • imclearborder
          Remove binary image components connected to the image border.
        • imclose
          Close an image by dilation followed by erosion.
        • imdilate
          Dilate a binary or grayscale image or volume.
        • imerode
          Erode a binary or grayscale image or volume.
        • imfill
          Fill holes in binary images.
        • imopen
          Open an image by erosion followed by dilation.
        • imtophat
          Top-hat filtering of an image.
        • strel
          Create a structuring element.
        Regions and Boundaries

        Functions for connected components, labels, region measurements, selection, and boundary tracing.

        • bwboundaries
          Find boundary pixels of binary regions.
        • bwconncomp
          Find connected components in a binary image or volume.
        • bwlabel
          Label connected components in a binary image.
        • bwselect
          Select connected binary objects.
        • bwtraceboundary
          Trace boundary pixels of a binary object.
        • labelmatrix
          Create label matrix from connected components.
        • regionprops
          Measure properties of image regions.
        Segmentation

        Functions for segmenting images using region growing, active contours, morphological reconstruction, h-minima/maxima, regional extrema, imposed minima, and watershed transforms.

        • activecontour
          Segment an image from an initial contour mask.
        • grayconnected
          Select a connected grayscale region from a seed pixel.
        • imextendedmax
          Find extended maxima in a 2-D image.
        • imextendedmin
          Find extended minima in a 2-D image.
        • imhmax
          Suppress shallow maxima using the h-maxima transform.
        • imhmin
          Suppress shallow minima using the h-minima transform.
        • imimposemin
          Impose regional minima at marker pixels.
        • imreconstruct
          Perform morphological reconstruction by dilation.
        • imregionalmax
          Find regional maxima in a 2-D image.
        • imregionalmin
          Find regional minima in a 2-D image.
        • watershed
          Compute watershed regions of a 2-D image or 3-D volume.
        Feature Detection

        Functions for corner metrics and local feature point detection.

          Geometry, Registration, and 3-D

          Functions for geometric transforms, spatial referencing, image registration, volumetric filtering, resizing, and 3-D measurements.

          Geometric Transforms

          Functions and objects for cropping, resizing, rotation, translation, spatial referencing, and geometric transforms in 2-D and foundational 3-D workflows.

          • affine2d
            Create a 2-D affine transformation structure.
          • affine3d
            Create a 3-D affine transformation structure.
          • fitgeotrans
            Fit a 2-D geometric transformation from control points.
          • imcrop
            Crop an image using a rectangle.
          • imref2d
            Create a 2-D spatial reference structure.
          • imref3d
            Create a 3-D spatial reference structure.
          • imregconfig
            Create default image registration optimizer and metric structures.
          • imregcorr
            Estimate a 2-D image registration transform by phase correlation.
          • imregister
            Register a moving image to a fixed image.
          • imregtform
            Estimate a 2-D registration transformation from images.
          • imresize
            Resize image by scale or output size
          • imrotate
            Rotate image by specified angle
          • imtranslate
            Translate an image in 2-D.
          • imwarp
            Warp an image or volume using a numeric transform matrix.
          • intrinsicToWorld
            Convert intrinsic image coordinates to world coordinates.
          • projective2d
            Create a 2-D projective transformation structure.
          • sizesMatch
            Determine whether a spatial reference matches an image size.
          • transformPointsForward
            Apply a forward geometric transformation to points.
          • transformPointsInverse
            Apply an inverse geometric transformation to points.
          • worldToIntrinsic
            Convert world coordinates to intrinsic image coordinates.
          • worldToSubscript
            Convert world coordinates to image subscripts.
          3-D Volumes

          Functions for filtering and processing volumetric image data.

          Image Registration

          Guides and entry points for aligning images, estimating registration transforms, and applying registered outputs.

            Web tools

            The WebTools module provides functions to interact with web resources, transfer data via URLs, and work with RESTful web services.

            Web view

            The WebView module opens local HTML, inline HTML text, web addresses and the examples gallery from Nelson.

            Dynamic link

            The Dynamic Link module enables Nelson to build, load, and call C/C++ and Fortran code at runtime.

            It supports generating gateways, loaders, and managing shared libraries for integration with external compiled code.

            By default, Nelson does not try to detect a C/C++ compiler on Windows. Do not forget to run 'configuremsvc' or 'configuremingw' once.

            MEX functions

            The MEX module allows C/C++ code to interface with Nelson and access Nelson's engine, variables, and functions.

            Fortran to C

            The F2C module allows Nelson users to convert legacy Fortran 77 source files into C code.

            This lets older Fortran routines compile, execute, and interact with Nelson variables from Nelson workflows.

            It is particularly useful for leveraging existing numerical algorithms or legacy scientific codebases within a modern Nelson environment.

            Validators

            The Validators module provides tools for enforcing constraints and verifying input values in Nelson.

            It supports checking data types, numerical properties, matrix and vector dimensions, text validity, file and folder existence, and logical or numeric conditions.

            This module ensures robust input validation, helping to prevent errors, enforce correctness, and improve the reliability of scripts and functions.

            Python engine

            The Python Engine module lets Nelson call Python code and use Python libraries alongside Nelson functions.

            It provides functions to run Python code, manage interpreter environments, and exchange data between Nelson and Python.

            Julia engine

            The Julia Engine module lets Nelson call Julia code and use Julia numerical libraries from the Nelson environment.

            It provides functions to run Julia code, manage interpreter environments, and exchange data between Nelson and Julia.

            GPU computing

            The GPU engine module runs array computations on the GPU through WebGPU (Dawn), portably on Windows, Linux and macOS without a proprietary CUDA dependency.

            Arrays are moved to the device with gpuArray and back to the host with gather. Operators and many functions are overloaded so that expressions on a gpuArray run on the device and keep their result device-resident.

            Device arrays are stored in single precision (WebGPU has no double compute type yet); real, logical and complex data are supported. Use canUseGPU to check availability and gpuDevice to inspect the selected device.

            Many functions are supported on a gpuArray: the operators, the element-wise math functions (including the rounding and hyperbolic/inverse-trigonometric ones), the reductions and scans (sum, prod, mean, var, std, cumsum, cumprod, sort, find), the complex-extraction functions, the shape and predicate functions, and the constructors zeros/ones/rand/randn through the 'gpuArray' / 'like' forms. Call gpuArrayFunctions for the exact, always-current list.

            Debugger functions

            The Debugger module in Nelson provides functions to inspect and analyze program execution.

            It is designed to help users identify errors, trace the flow of execution, and better understand the state of variables during runtime.

            Text editor debugging features integrate with these functions for interactive debugging.

            Profiling tools

            The Profiler module in Nelson provides functions to measure and analyze the execution performance of code.

            It helps users identify bottlenecks, optimize slow parts of programs, and improve overall efficiency.

            Tests framework for Nelson

            The Test Manager module in Nelson provides tools for automated testing of code, enabling users to validate functionality, ensure correctness, and manage test cases efficiently.

            This module supports creating reference outputs, running test suites, and conditionally skipping tests.

            Assertion functions

            The assert_functions module provides assertion tools for unit tests, runtime contracts and diagnostic checks.

            All assertions share the same contract: with no output they raise an error on failure; with outputs they return [res, msg].

            The canonical API uses qualified assertion names, for example asserts.isequal, asserts.warning and asserts.satisfies.

            Documentation and Help Management

            The Help Tools module provides functions to create, convert, and manage documentation for Nelson.

            It generates help content in formats such as HTML, Markdown, PDF, and website-ready output for maintaining and distributing documentation.

            Optimization

            The Optimization module provides scalar minimization, unconstrained minimization, zero finding, nonlinear equations, nonlinear least squares, nonnegative least squares, quadratic programming, solver options, and a first problem-based modelling layer.

            The implemented algorithms are deterministic dense numerical methods intended for small and medium-size engineering models in Nelson.

            NFlow blocks

            The nflow_blocks module provides the simulation blocks used by NFlow, including their ports, parameters, phases, and runtime behavior.

            NFlow is currently released as 1.0.0-beta.1: it is functional and tested, but details of its interfaces and file format may still evolve based on feedback.

            Electrical (acausal)

            Acausal (physical) blocks with undirected pins, simulated natively through the differential-algebraic engine.

            • CCC
              Current-controlled current source: i_pn = gain i_cp (the sense branch cp-cn is a short).
            • CCV
              Current-controlled voltage source: v_pn = gain i_cp (the sense branch cp-cn is a short).
            • Capacitor
              Ideal linear capacitor: i = C dv/dt.
            • Conductor
              Ideal linear conductor: i = G (v_p - v_n).
            • ConstantCurrent
              Constant current source: current I flows p -> n.
            • ConstantVoltage
              Constant voltage source: v_p - v_n = V.
            • CurrentSensor
              Measures the branch current p -> n (ideal ammeter).
            • Diode
              Exponential (Shockley) diode: i = Is (exp(vd/Vt) - 1).
            • ExpSineCurrent
              Exponentially damped sine current source.
            • ExpSineVoltage
              Exponentially damped sine voltage source.
            • Ground
              Reference node (0 V) for an electrical island.
            • Gyrator
              Gyrator: i1 = G2 v2, i2 = -G1 v1 (across<->through transducer).
            • HeatingResistor
              Resistor that dissipates its power P = v^2 / R as heat into a thermal port.
            • IdealDiode
              Ideal diode switching at the knee voltage Vknee: off below it (leak conductance Goff), on above it (on-resistance Ron in series with Vknee); the mode flip is an event.
            • IdealOpAmp
              Ideal op-amp (nullor): virtual short e_+ = e_-, output current free.
            • IdealSwitch
              Ideal switch: control > 0.5 -> closed short, else open (i = 0).
            • IdealTransformer
              Ideal transformer: v1 = n v2, i2 = -n i1 (structural, no state storage).
            • Idle
              Ideal open branch: i = 0 (branch voltage free).
            • Inductor
              Ideal linear inductor: v = L di/dt.
            • NMOS
              N-channel MOSFET (square law): drain, gate and source pins.
            • NPN
              NPN bipolar transistor (Ebers-Moll): collector, base and emitter pins.
            • PMOS
              P-channel MOSFET (square law): drain, gate and source pins.
            • PNP
              PNP bipolar transistor (Ebers-Moll): collector, base and emitter pins.
            • PotentialSensor
              Measures the absolute node potential.
            • RampCurrent
              Ramp current source: i = Slope (t - StartTime) for t >= StartTime, else 0.
            • RampVoltage
              Ramp voltage source: v = Slope (t - StartTime) for t >= StartTime, else 0.
            • Resistor
              Ideal linear resistor: i = (v_p - v_n) / R.
            • Short
              Ideal short circuit: e_p = e_n (branch current free).
            • SignalCurrent
              Current source driven by the input signal.
            • SignalVoltage
              Voltage source driven by the input signal.
            • SineCurrent
              Sine current source: i = Amplitude sin(2 pi Frequency t + Phase).
            • SineVoltage
              Sine voltage source: v = Amplitude sin(2 pi Frequency t + Phase).
            • TrapezoidCurrent
              Trapezoidal current source (continuous ramp-up / hold / ramp-down).
            • TrapezoidVoltage
              Trapezoidal voltage source (continuous ramp-up / hold / ramp-down).
            • VCC
              Voltage-controlled current source: i = gain (v_cp - v_cn).
            • VCV
              Voltage-controlled voltage source: v_pn = gain (v_cp - v_cn).
            • VariableCapacitor
              Capacitor whose capacitance C is set by a signal (exact charge Q formulation).
            • VariableConductor
              Conductor whose conductance G is set by the input signal.
            • VariableInductor
              Inductor whose inductance L is set by a signal (exact flux phi formulation).
            • VariableResistor
              Resistor whose resistance R is set by the input signal.
            • VoltageSensor
              Measures the voltage v_p - v_n (ideal, no loading).
            • ZDiode
              Zener diode: forward Shockley conduction plus reverse breakdown at -Vz.
            Planar (acausal)

            Acausal (physical) blocks with undirected pins, simulated natively through the differential-algebraic engine.

            • PlanarAccelerationSensor
              Absolute acceleration of the body at frame a along the chosen axis (x, y) or the angular acceleration (alpha).
            • PlanarBody
              Rigid body: mass m, central inertia I; six states (xc, yc, phi, vx, vy, w). Named frames are body-fixed offsets from the COM.
            • PlanarDamper
              Linear 2D damper between the points at frames a and b: F = -d dv.
            • PlanarDistance
              Rigid rod: holds a fixed distance L between the points at frames a and b.
            • PlanarDistanceSensor
              Distance between the points at frames a and b.
            • PlanarFixed
              Frame rigidly fixed at the world point (x, y).
            • PlanarForce
              External world force (fx, fy) applied at the frame-a point (adds a torque when offset from the COM).
            • PlanarPointMass
              Point mass (no orientation): four states (xc, yc, vx, vy); attach joints at its point.
            • PlanarPositionSensor
              Absolute position of the frame-a point along the chosen axis (x, y) or the body angle (phi).
            • PlanarPrismatic
              Prismatic joint: frame b slides along the world axis (dx, dy) through frame a, relative rotation locked.
            • PlanarRelPositionSensor
              Relative position of the frame-a point minus the frame-b point along the chosen axis (x, y).
            • PlanarRelativeTorque
              Actuator torque: +tau on the body at frame a, -tau on the body at frame b (drives a joint).
            • PlanarRevolute
              Revolute (pin) joint: frames a and b share position, free relative rotation.
            • PlanarRollingWheel
              Wheel at frame a rolls without slipping on the fixed surface line (px,py)+(dx,dy), staying at height radius.
            • PlanarSpring
              Linear 2D spring between the points at frames a and b: F = -c dr.
            • PlanarSpringDamper
              Linear 2D spring-damper between the points at frames a and b: F = -(c dr + d dv).
            • PlanarTorque
              External torque tau applied to the body at frame a.
            • PlanarVelocitySensor
              Absolute velocity of the frame-a point along the chosen axis (x, y) or the angular velocity (omega).
            • PlanarWorld
              Inertial world with uniform gravity (down = -y); provides a fixed frame at the origin.
            Rotational (acausal)

            Acausal (physical) blocks with undirected pins, simulated natively through the differential-algebraic engine.

            • AngleSensor
              Measures the absolute angle of a flange.
            • BearingFriction
              Regularised bearing friction (event-free): tau = -tau_c tanh(w / w_eps).
            • Clutch
              Rotational clutch (event-free stick-slip): tau = tau_max tanh((w_a - w_b) / w_eps) reduces the slip toward a common speed.
            • ConstantRotSpeed
              Prescribed motion: the flange rotates at a constant angular velocity w.
            • ConstantTorque
              Constant torque on a flange.
            • EMF
              Electro-mechanical converter (motor/generator): back-emf v = k w, torque tau = k i.
            • ElastoBacklash
              Rotational backlash: elastic torque with a dead zone of total play b.
            • ExpSineTorque
              Exponentially damped sine torque on a flange.
            • Freewheel
              One-way clutch: couples flange a to b only while a overruns b (freewheels otherwise).
            • IdealGear
              Ideal gear phi_a = ratio phi_b (structural node merge, inertia folded).
            • Inertia
              Rotational inertia: J dw/dt = tau_net.
            • LinearSpeedDependentTorque
              Speed-proportional resistance to ground: tau = -d w.
            • QuadraticSpeedDependentTorque
              Quadratic (drag) resistance to ground: tau = -d w |w|.
            • RampTorque
              Ramp torque on a flange: tau = Slope (t - StartTime) for t >= StartTime, else 0.
            • RelAngleSensor
              Measures the relative angle phi_a - phi_b between two flanges.
            • RelRotSpeedSensor
              Measures the relative angular velocity w_a - w_b between two flanges.
            • RotAccelerate
              Prescribed motion: the flange angular acceleration follows the input signal.
            • RotBrake
              Signal-actuated rotational brake to ground: the input sets the peak braking torque.
            • RotDamper
              Rotational damper: tau = d (w_a - w_b).
            • RotFixed
              Flange fixed at a prescribed angle phi0.
            • RotSpeed
              Prescribed motion: the flange angular velocity follows the input signal.
            • RotSpeedSensor
              Measures the absolute angular velocity of a flange.
            • RotSpring
              Rotational spring: tau = c (phi_a - phi_b).
            • RotSpringDamper
              Parallel rotational spring and damper: tau = c (phi_a - phi_b) + d (w_a - w_b).
            • SineTorque
              Sine torque on a flange: tau = Amplitude sin(2 pi Frequency t + Phase).
            • Torque
              External torque on a flange, driven by the input signal.
            • Torque2
              Equal and opposite torque between two flanges: +tau on a, -tau on b (signal-driven).
            • TrapezoidTorque
              Trapezoidal torque on a flange (continuous ramp-up / hold / ramp-down).
            Thermal (acausal)

            Acausal (physical) blocks with undirected pins, simulated natively through the differential-algebraic engine.

            Translational (acausal)

            Acausal (physical) blocks with undirected pins, simulated natively through the differential-algebraic engine.

            • Accelerate
              Prescribed motion: the flange acceleration follows the input signal.
            • Brake
              Signal-actuated friction brake to ground: the input sets the peak braking force.
            • ConstantForce
              Constant force on a flange.
            • ConstantSpeed
              Prescribed motion: the flange moves at a constant velocity v.
            • Damper
              Linear translational damper: F = d (v_a - v_b).
            • ElastoGap
              One-sided contact spring-damper: acts only while the gap is closed (s_rel < s_rel0).
            • ExpSineForce
              Exponentially damped sine force on a flange.
            • Fixed
              Flange fixed at a prescribed position s0.
            • Force
              External force on a flange, driven by the input signal.
            • Force2
              Equal and opposite force between two flanges: +F on a, -F on b (signal-driven).
            • Friction
              Regularised Coulomb friction (event-free): F = -Fc tanh(v / vEps).
            • Lever
              Lever (small-angle): s_a = ratio s_b, the arm ratio (structural merge).
            • LinearSpeedDependentForce
              Speed-proportional resistance to ground: F = -d v.
            • Mass
              Sliding mass with inertia: m dv/dt = F_net.
            • MassWithWeight
              Sliding mass under gravity: m dv/dt = F_net - m g (expands to Mass + ConstantForce).
            • PositionSensor
              Measures the absolute position of a flange.
            • Pulley
              Ideal pulley: s_a = ratio s_b (structural merge; ratio = radius ratio).
            • QuadraticSpeedDependentForce
              Quadratic (drag) resistance to ground: F = -d v |v|.
            • RampForce
              Ramp force on a flange: F = Slope (t - StartTime) for t >= StartTime, else 0.
            • RelPositionSensor
              Measures the relative position s_a - s_b between two flanges.
            • RelSpeedSensor
              Measures the relative velocity v_a - v_b between two flanges.
            • Rod
              Rigid massless rod: s_a = s_b (structural merge; ratio defaults to 1).
            • SineForce
              Sine force on a flange: F = Amplitude sin(2 pi Frequency t + Phase).
            • SlidingMass
              Sliding mass of length L: m dv/dt = F_net (L is geometric, does not affect the dynamics).
            • Speed
              Prescribed motion: the flange velocity follows the input signal.
            • SpeedSensor
              Measures the absolute velocity of a flange.
            • Spring
              Linear translational spring: F = k (s_a - s_b).
            • SpringDamper
              Parallel spring and damper: F = k (s_a - s_b) + d (v_a - v_b).
            • TranslationalEMF
              Linear electro-mechanical converter: back-emf v = k v_flange, force F = k i.
            • TrapezoidForce
              Trapezoidal force on a flange (continuous ramp-up / hold / ramp-down).
            Continuous blocks

            Stateful continuous-time blocks updated with the simulation step.

            • constraint
              Algebraic (differential-algebraic) constraint state solved by the DAE solver.
            • delay
              Delays a signal with a circular buffer.
            • derivative
              Estimates the time derivative of an input.
            • hpf
              Applies a first-order high-pass filter.
            • integrator
              Integrates the input over time with optional clamps.
            • lpf
              Applies a first-order low-pass filter.
            • pid
              Implements a scalar PID controller with output limits.
            • stateSpace
              Implements a scalar continuous state-space model.
            • tf
              Implements a continuous transfer function approximation.
            Dashboard blocks

            Interactive dashboard widgets that bind to signals and parameters to observe or drive a running model.

            Discrete blocks

            Sampled blocks that store values, histories, or discrete states.

            • ddelay
              Delays a sampled signal by an integer number of steps.
            • detectChange
              Outputs 1 on any step where the input differs from the previous step.
            • detectDecrease
              Outputs 1 when the input strictly decreases from the previous step.
            • detectIncrease
              Outputs 1 when the input strictly increases from the previous step.
            • difference
              Outputs the difference from the previous input.
            • dstateSpace
              Implements a scalar discrete state-space model.
            • dtf
              Implements a discrete transfer function.
            • fallingEdge
              Outputs 1 on the step where the input crosses from >= 0 to < 0.
            • foh
              First-order hold for sampled input values.
            • rateTransition
              Resamples a signal at its own sample time (zero-order hold).
            • risingEdge
              Outputs 1 on the step where the input crosses from <= 0 to > 0.
            • unitDelay
              Delays the input by one update.
            • zoh
              Samples an input and holds the last sampled value.
            FMI and Modelica blocks

            Blocks that import, execute, or compile Functional Mock-up Units and models.

            • fmu
              Runs a co-simulation FMU inside an NFlow diagram.
            • fmuMe
              Integrates a model-exchange FMU with the NFlow solver.
            • modelica
              Compiles a Modelica model and uses it as an NFlow block.
            Logic blocks

            Boolean and comparison blocks for numeric signals.

            • and
              Outputs the logical AND of two inputs.
            • bitClear
              Clears the bit at position BitIndex of the integer input to 0.
            • bitSet
              Sets the bit at position BitIndex of the integer input to 1.
            • bitwiseOperator
              Bit-wise AND/OR/XOR/NAND/NOR/NOT of the input against a constant BitMask.
            • combinatorialLogic
              Truth-table lookup: an N-bit input vector indexes a 2^N-entry TruthTable.
            • compareToConstant
              Compares one input to a constant threshold.
            • compareToZero
              Compares one input to zero.
            • extractBits
              Extracts NumBitsToExtract bits starting at StartBit, right-aligned.
            • if
              Selects an action output from a boolean expression over the inputs.
            • intervalTest
              Outputs 1 when the input lies within [LowerLimit, UpperLimit], else 0.
            • intervalTestDynamic
              Like intervalTest but the bounds come from input ports (lo, u, up).
            • logicalOperator
              Configurable logical AND/OR/NAND/NOR/XOR/XNOR/NOT of the inputs.
            • not
              Outputs the logical negation of one input.
            • or
              Outputs the logical OR of two inputs.
            • relationalOperator
              Compares two input signals.
            • shiftArithmetic
              Arithmetic bit shift left/right by ShiftNumber (signed 64-bit).
            • switchCase
              Routes an integer control to one of several action outputs.
            • xor
              Outputs the logical exclusive OR of two inputs.
            Lookup Tables

            Interpolated and direct lookup-table blocks (1-D, 2-D, n-D and direct).

            • directLookup
              Direct (n-D) lookup table without interpolation.
            • interpolationPrelookup
              Interpolates a static Table from a prelookup [k, f] pair.
            • lookup1D
              1-D interpolated lookup table.
            • lookup2D
              2-D interpolated lookup table.
            • lookupDynamic
              1-D interpolated lookup with breakpoints and table taken from input ports.
            • lookupND
              n-D interpolated lookup table.
            • prelookup
              Computes the interval index k and fraction f for a shared breakpoint search.
            Math blocks

            Algebraic scalar math operations.

            • abs
              Outputs the absolute value of its input.
            • atan2
              Four-quadrant arctangent of the two inputs.
            • bias
              Adds a constant bias to the input.
            • complexToMagnitudeAngle
              Outputs the magnitude and angle of a complex signal.
            • complexToRealImag
              Splits a complex signal into real and imaginary outputs.
            • conjugate
              Complex conjugate of the input signal.
            • crossProduct
              Cross product of two 3-element vectors.
            • divide
              Divides input 1 by input 2.
            • dotProduct
              Dot product of two vector inputs.
            • gain
              Multiplies the input by a scalar gain.
            • magnitudeAngleToComplex
              Builds a complex signal from magnitude and angle inputs.
            • mathFunction
              Mathematical function of the input.
            • matmul
              Multiplies two matrix signals or applies element-wise multiplication.
            • max
              Outputs the maximum of two inputs.
            • min
              Outputs the minimum of two inputs.
            • mult
              Multiplies connected inputs.
            • negate
              Negates the input signal.
            • polynomial
              Evaluates a polynomial with constant Coefficients (highest power first).
            • productOfElements
              Product of the elements of a vector input.
            • realImagToComplex
              Builds a complex signal from real and imaginary inputs.
            • roundingFunction
              Rounds the input to an integer value.
            • sign
              Signum of the input (-1, 0 or +1).
            • sqrt
              Square-root family of the input.
            • sum
              Adds connected inputs with configurable signs.
            • sumElements
              Sum of the elements of a vector input.
            • trigFunction
              Trigonometric function of the input.
            • wrapToZero
              Outputs 0 when the input reaches Threshold, else passes it through.
            Nonlinear blocks

            Blocks with saturation, thresholds, hysteresis, or rate limits.

            • backlash
              Models backlash with a dead band around the previous output.
            • coulombViscousFriction
              Static friction: viscous term Gain*u plus signed Coulomb term Offset*sign(u).
            • deadZone
              Suppresses values inside a dead zone.
            • hitCrossing
              Outputs 1 on the step where the input crosses HitCrossingOffset.
            • hysteresis
              Relay: latching two-threshold switch (uHigh, uLow, yHigh, yLow).
            • quantizer
              Rounds the input to the nearest interval.
            • rate
              Limits rising and falling signal rates.
            • saturation
              Clamps the input between min and max.
            Sink blocks

            Blocks that consume, display, or name signals.

            • display
              Stores the latest input value for display.
            • fileSink
              Represents a file output sink.
            • labelSink
              Names an input signal for label routing.
            • scope
              Stores time-series samples for display.
            • stopSimulation
              Ends the run at the end of the step where its input first becomes nonzero.
            • terminator
              Consumes an intentionally unused signal.
            • toWorkspace
              Writes the input signal to a Nelson workspace variable.
            • xyScope
              Stores paired X/Y samples for display.
            • xyzScope
              Stores X/Y/Z samples for 3D display.
            Source blocks

            Blocks that generate signals from parameters, time, labels, or files.

            • chirp
              Generates a sine chirp from f0 to f1.
            • clock
              Outputs the current simulation time.
            • constant
              Outputs a constant numeric value.
            • counterFreeRunning
              Free-running up-counter, wraps modulo 2^NumBits.
            • counterLimited
              Up-counter that wraps back to 0 once it reaches UpperLimit.
            • enumeratedConstant
              Outputs a fixed enumeration value (EnumClass documents it, Value is the number).
            • fileSource
              Outputs values from preloaded times and values arrays.
            • fromWorkspace
              Reads a signal from a Nelson workspace variable.
            • impulse
              Outputs an impulse at a configured time.
            • labelSource
              Reads a signal from a matching labelSink.
            • noise
              Generates deterministic pseudo-random noise.
            • pulse
              Pulse Generator: a periodic pulse train (Amplitude, Period, Width, StartTime, Offset).
            • ramp
              Generates a ramp beginning at start.
            • repeatingSequenceInterpolated
              Periodic piecewise-linear source interpolating a (TimeValues, OutValues) table.
            • repeatingSequenceStair
              Periodic staircase: one OutValues entry per sample, repeating.
            • signalGenerator
              Configurable periodic source: sine, square or sawtooth (Amplitude, Frequency).
            • sine
              Generates a sinusoidal signal.
            • step
              Generates a unit step at stepTime.
            User-Defined Function blocks

            Blocks that evaluate user-provided expressions or Nelson functions.

            • expression
              Evaluates a restricted math expression of u during simulation and in generated code.
            • nelsonFunction
              Evaluates a Nelson function at every simulation step.
            Utility blocks

            Blocks for routing, grouping, annotation, and interactive switching.

            • assignment
              Writes elements into a signal: out = base with out[Indices] = values.
            • busAssignment
              Replaces selected members of a bus, passing the rest through unchanged.
            • busCreator
              Groups heterogeneous signals (or nested buses) into one bus.
            • busSelector
              Extracts members from a bus by path.
            • comment
              Adds non-executed annotation text to a diagram.
            • concatenate
              Concatenates input signals along a selected dimension.
            • convert
              Converts a signal to a selected data type.
            • dataStoreMemory
              Declares a named scalar memory shared across the model (initial value).
            • dataStoreRead
              Outputs the value of the named data store.
            • dataStoreWrite
              Writes its input to the named data store.
            • demux
              Routes one input to multiple output ports.
            • functionCallGenerator
              Drives a function-call subsystem a fixed number of times per step.
            • functionCallSplit
              Fans one function-call out to several callees in order.
            • initialCondition
              Forces the output to InitialValue at the first step, then passes the input.
            • iteratorCondition
              carries the continue predicate of a While Iterator subsystem
            • iteratorNumber
              outputs the current iteration index inside a For/While iterator subsystem
            • merge
              Recombines the outputs of mutually-exclusive conditional subsystems.
            • multiportSwitch
              Routes one of several data inputs to the output, selected by a control input.
            • mux
              Groups multiple input routes into one output route.
            • reshape
              Changes signal dimensions without changing element values.
            • selector
              Selects elements from an input signal by one-based indices.
            • signalConversion
              Pass-through that copies its input to its output unchanged (conversion point).
            • subsystem
              Runs a nested block diagram as a single block.
            • switch
              Selects between top and bottom inputs using a condition input.
            • toggleSwitch
              Outputs one of two configured values from state.
            • width
              Outputs the number of elements (width) of its input signal, as a scalar.
            nflow engine

            Programmatic creation and editing of nflow block-diagram models.

            NFlow is currently released as 1.0.0-beta.1: it is functional and tested, but details of its interfaces and file format may still evolve based on feedback.

            NFlow FMI import

            The NFlow FMI module imports Functional Mock-up Units (FMUs) that follow the FMI 3.0 standard and runs them as Co-Simulation or Model Exchange components.

            NFlow is currently released as 1.0.0-beta.1: it is functional and tested, but details of its interfaces and file format may still evolve based on feedback.

            It reads the model description of an FMU, exposes its variables and interfaces, and either drives a fixed-step Co-Simulation (the FMU owns its solver) or integrates a Model Exchange FMU with NFlow's own solver, recording the FMU outputs over time.

            Functions accept either a .fmu archive or an already-extracted FMU directory. Archives are unpacked with a ZIP-slip-hardened extractor into a temporary directory that is removed automatically.

            The same import also backs two blocks in the NFlow editor (category FMI): an FMU block (Co-Simulation) and an FMU (ME) block (Model Exchange, whose continuous states join the diagram's global solver). Drop a block, click Browse FMU... to pick a .fmu, and its input and output ports are configured automatically from the model description. Ready-to-open demo diagrams for several reference FMUs (VanDerPol, BouncingBall, Dahlquist, StateSpace, Feedthrough) ship in the module examples directory.

            Area Main entries
            Model description fmiInfo
            Co-Simulation fmiCoSimulate
            Model Exchange fmiModelExchange
            Modelica bridge modelicaInfo, modelicaConfigure, modelicaToFmu
            FMU import assistant fmuToBlock

            The FMU import assistant (fmuToBlock) turns any FMU into a native-looking nflow block -- input and output ports from the model description, parameters, and the FMU icon -- ready to drop into a library. It pairs with the Modelica bridge: modelicaToFmu produces an FMU, fmuToBlock wraps it as a block.

            The Modelica bridge lets an nflow model include a modelica block that references a Modelica model. At simulation time the model is compiled to an FMU with a user-installed OpenModelica and imported through the FMI path above, so physical (acausal) Modelica models simulate alongside ordinary blocks. modelicaInfo and modelicaConfigure report and select the OpenModelica used; modelicaToFmu performs the compilation. Worked examples (RC, RLC, mass-spring-damper) ship in the module examples/modelica directory.

            nflow editor

            The nflow editor is Nelson's block-diagram environment for building and simulating dynamic systems.

            It provides a visual editor for wiring blocks and subsystems, saving and loading diagrams in the .nflow JSON format, and running simulations with either the fixed-step engine or the variable-step (CVODES) solver, with zero-crossing detection for discontinuous blocks.

            Diagrams can also be turned into standalone C or Rust code through the code generator.

            NFlow is currently released as 1.0.0-beta.1: it is functional and tested, but details of its interfaces and file format may still evolve based on feedback.

            Package manager window
            Graphical front-end for the nmm package manager.
            Standalone application compiler

            The optional compiler module analyzes dependencies and builds native applications from .m files.

            Use ncc to load the module on demand. compiler.build provides console and no-console standalone builds, shared options and read-only results with runtime dependency tables. The nelson.compiler interfaces retain the existing bundled-runtime path. Tutorials cover multiple functions, embedded data and both build interfaces.