Main Content

FunctionApproximation.Options class

包裹:FunctionApproximation

指定与FunctionApproximation.Problem目的

Description

FunctionApproximation.Options对象包含定义的其他选项FunctionApproximation.Problem目的。

建造

options= functionApproximation.options()创建一个FunctionApproximation.Options目的至use as an input to aFunctionApproximation.Problem目的。这output,options,使用默认属性值。

options= FunctionApproximation.Options(姓名,,,,Value创建一个FunctionApproximation.Options目的with property values specified by one or more姓名,,,,Valuepair arguments.姓名must appear inside single quotes ('')。You can specify several name-value pair arguments in any order as姓名1,,,,Value1,...,NameN,ValueN

特性

expand all

Maximum tolerance of the absolute value of the difference between the original output value and the output value of the approximation, specified as a non-negative scalar.

Data Types:单身的|double|int8|int16|int32|int64|UINT8|uint16|UINT32|Uint64|fi

是否允许在近似过程中更新模型图,,,,specified as a numeric or logical1((true)or0((错误的)。This property is only relevant forFunctionApproximation.Problem指定一个的对象Lookup Table块或一个数学功能block as the item to approximate.

Data Types:逻辑

How to output optimized lookup table, specified as'Simulink'or'MATLAB'。当此属性设置为'Simulink', 这近似method produces a Simulink®包含优化查找表的子系统。当此属性设置为'MATLAB', 这近似method outputs the optimized lookup table as a MATLAB®功能。

Generating an optimized lookup table as a MATLAB function is not supported when:

  • autosarcompliantproperty is set totrue

  • UseParallelproperty is set totrue

  • HDLOptimizedproperty is set totrue

  • 插值仪property is set to'None'

笔记

这Simulink block and MATLAB function lookup table approximations generated by theFunctionApproximationpackage may not be exactly numerically equivalent. However, both solution forms are guaranteed to meet all constraints specified in the optimization problem.

Example:options.ApproximateSolutionType ='MATLAB';

Data Types:char

生成的查找表是否符合AutoSar,指定为数字或逻辑1((true)or0((错误的)。当此属性设置为1((true),生成的查找表是CurveorMap距离AUTOSAR Blockset。当此属性设置为1((true),,,,the data type of the table data must equal the output data type of the block.

Setting this property to1((true)检查一个AUTOSAR Blocksetlicense when you use the近似orreplaceWithApproximatemethods.

This property is not supported when theApproximateSolutionTypeproperty is set to'MATLAB'

Data Types:逻辑

断点数据的间距,,,,specified as one of the following values.

Breakpoint Specification Description
显式价值 Lookup table breakpoints are specified explicitly. Breakpoints can be closer together for some input ranges and farther apart in others.
EvenSpacing 查找表断点均匀分布。
均匀的速度 Lookup table breakpoints use power-of-two spacing. This breakpoint specification boasts the fastest execution speed because a bit shift can replace the position search.

有关断点规范如何影响性能的更多信息,请参见Effects of Spacing on Speed, Error, and Memory Usage

Data Types:char

是否显示优化的每次迭代的详细信息,指定为数字或逻辑1((true)or0((错误的)。A value of1((true在命令窗口中的信息)的结果each iteration of the approximation process. A value of0((错误的)在近似完成之前不显示信息。

Data Types:逻辑

Whether to allow the optimizer to explore half-precision data types for table data and breakpoints, specified as a numeric or logical1((true)or0((错误的)。

Data Types:逻辑

Whether to generate an HDL-optimized approximate, specified as a numeric or logical1((true)or0((错误的)。A value of1((true)导致大概是一个子系统,该子系统由预插步骤组成,然后进行插值,该系统充当带有显式管道的查找表以生成有效的HDL代码。

要产生HDL优化的近似值,近似函数必须是一维的,并且BreakpointSpecificationmust be set toEvenSpacingor均匀的速度

This property is not supported when theApproximateSolutionTypeproperty is set to'MATLAB'

Data Types:逻辑

当输入落在断点值之间时,查找表使用相邻的断点将输出值插值。

插值法 Description
线性 拟合相邻断点之间的一条线,并返回该行上的点与输入相对应。
Flat 返回对应于断点值立即小于输入值的输出值。如果不存在以下输入值的断点值,则它将返回最接近输入值的断点值。
最近 Returns the value corresponding to the breakpoint that is closest to the input. If the input is equidistant from two adjacent breakpoints, the breakpoint with the higher index is chosen.
None

生成a直接查找表(N-D)块,执行表格查找,而无需任何插值或外推。

笔记

When generating a直接查找表块,最大输入数为两个。

这interpolation methodNone当金宝appApproximateSolutionTypeproperty is set to'MATLAB'

Data Types:char

生成的查找表可以用位指定为标量整数的最大内存量。您可以使用MemoryUnits财产。

Data Types:double

近似运行的最大时间,以秒为单位指定为标量号。近似一直运行,直到达到指定的时间,找到理想的解决方案或达到另一个停止标准。

Data Types:double

单位MaxMemoryUsage属性,指定为',,,,'bytes',或其他列举选项之一。

Data Types:char

Whether to constrain table values to the quantized output of the function being approximated, specified as a numeric or logical1((true)or0((错误的)。By setting this property to0((错误的)and allowing off-curve table values, you may be able to reduce the memory of the lookup table while maintaining the same error tolerances, or maintain the same memory while reducing the error tolerances.

Data Types:逻辑

Maximum tolerance of the relative difference between the original output value and the output value of the approximation, specified as a non-negative scalar.

Data Types:单身的|double|int8|int16|int32|int64|UINT8|uint16|UINT32|Uint64|fi

是否将功能的输出范围自动饱和到近似于输出数据类型的范围(指定为数字或逻辑)1((true)or0((错误的)。

Example:options.saturateToOutputType = 1;

Data Types:逻辑

Whether to run iterations of the optimization in parallel, specified as a numeric or logical1((true)or0((错误的)。Running the iterations in parallel requires a Parallel Computing Toolbox™ license. If you do not have a Parallel Computing Toolbox license, or if you specify0((错误的),迭代以序列形式运行。

This property is not supported when theApproximateSolutionTypeproperty is set to'MATLAB'

Example:options.UseParallel = true;

Data Types:逻辑

Specify the word lengths, in bits, that can be used in the lookup table approximate based on your intended hardware. For example, if you intend to target an embedded processor, you can restrict the data types in your lookup table to native types, 8, 16, and 32. The word lengths must be between 1 and 128.

Example:options.WordLengths = [8,16,32];

Data Types:单身的|double|int8|int16|int32|int64|UINT8|uint16|UINT32|Uint64|fi

复制语义

Value. To learn how value classes affect copy operations, seeCopying Objects

Limitations

  • 查找表对象和断点对象在模型蒙版工作区中不支持。金宝app

Algorithms

When you setBreakpointSpecification'ExplicitValues',在近似过程中,该算法还尝试使用'EvenSpacing'and'EvenPow2Spacing'。同样,当您设置BreakpointSpecification'EvenSpacing', 这algorithm also attempts to find a solution using'EvenPow2Spacing'。If you set the property to'EvenPow2Spacing',该算法仅尝试使用此间距找到解决方案。

In cases where theBreakpointSpecificationproperty is set to'EvenSpacing',但是inputupperboundsorinputlowerboundsproperty of theFunctionApproximation.Problem目的is equal to the range of the输入类型,该算法不会尝试使用'EvenPow2Spacing'

版本历史记录

在R2018A中引入