主要内容

totalmemoryusage

计算查找表逼近使用的总内存量

语法

memory = totalmemoryusage(solution,units)

说明

memory = totalmemoryusage(solution,units) 返回由 solution 指定的查找表逼近使用的总内存量,单位由 units 指定。

输入参数

全部展开

要获取内存的解,指定为 FunctionApproximation.LUTSolution 对象。

显示总内存使用量所用的单位,指定为字符向量。

数据类型: char

输出参量

全部展开

查找表逼近使用的总内存量,以标量形式返回。

示例

全部展开

创建一个 FunctionApproximation.Problem 对象,用于定义要逼近的数学函数。然后,使用 solve 方法获取一个 FunctionApproximation.LUTSolution 对象。

使用 totalmemoryusage 方法计算 FunctionApproximation.LUTSolution 对象使用的总内存量。

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

版本历史记录

在 R2018a 中推出