This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

totalmemoryusage

Class: FunctionApproximation.LUTSolution
Package: FunctionApproximation

Calculate total memory used by a lookup table approximation

Syntax

memory = totalmemoryusage(solution,units)

Description

memory = totalmemoryusage(solution,units) returns the total memory used by the lookup table approximation specified by solution, in the units specified by units.

Input Arguments

expand all

Solution to get memory of, specified as a FunctionApproximation.LUTSolution object.

Units in which to display the total memory used, specified as a character vector.

Data Types: char

Output Arguments

expand all

Total memory used by a lookup table approximation, returned as a scalar.

Examples

expand all

Create a FunctionApproximation.Problem object defining a math function to approximate. Then, use the solve method to get a FunctionApproximation.LUTSolution object.

Calculate the total memory used by the FunctionApproximation.LUTSolution object using the totalmemoryusage method.

problem = FunctionApproximation.Problem('sin')
problem = 

  FunctionApproximation.Problem with properties

    FunctionToApproximate: @(x)sin(x)
           NumberOfInputs: 1
               InputTypes: "numerictype(0,16,13)"
         InputLowerBounds: 0
         InputUpperBounds: 6.2832
               OutputType: "numerictype(1,16,14)"
                  Options: [1×1 FunctionApproximation.Options]
solution = solve(problem)
solution = 

  FunctionApproximation.LUTSolution with properties

          ID: 8
    Feasible: "true"
totalmemoryusage(solution, 'bytes')
ans =

    58

Introduced in R2018a