Main Content


Class: FunctionApproximation.LUTSolution
Namespace: FunctionApproximation

Calculate total memory used by a lookup table approximation


memory = totalmemoryusage(solution,units)


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.


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 =


Version History

Introduced in R2018a