solve
求解函数逼近问题的优化解
语法
solution = solve(problem)
说明
求解由 solution
= solve(problem
)FunctionApproximation.Problem
对象 problem
定义的优化问题,并将优化结果 solution
以 FunctionApproximation.LUTSolution
对象形式返回。
输入参数
problem
— 优化问题
FunctionApproximation.Problem
优化问题指定为 FunctionApproximation.Problem
对象,用来定义要逼近的函数或 Math Function 模块,或要优化的 Lookup Table 模块,以及在优化过程中使用的其他参数和约束。
输出参数
solution
— 逼近解
FunctionApproximation.LUTSolution
对象
逼近解,以 FunctionApproximation.LUTSolution
对象形式返回。
示例
逼近数学函数
创建一个 FunctionApproximation.Problem
对象,用它指定要逼近的数学函数。
problem = FunctionApproximation.Problem('log')
problem = FunctionApproximation.Problem with properties FunctionToApproximate: @(x)log(x) NumberOfInputs: 1 InputTypes: "numerictype(1,16,10)" InputLowerBounds: 0.6250 InputUpperBounds: 15.6250 OutputType: "numerictype(1,16,13)" Options: [1×1 FunctionApproximation.Options]
对所有其他选项使用默认值。
使用 solve
方法生成函数的逼近。
solution = solve(problem)
| ID | Memory (bits) | ConstraintMet | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) | | 0 | 64 | 0 | 2 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 1.178125e+00 | | 1 | 1984 | 1 | 122 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 4.192649e-03 | | 2 | 1024 | 0 | 62 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 1.416713e-02 | | 3 | 1968 | 1 | 121 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 4.192649e-03 | | 4 | 64 | 0 | 2 | 16 | 16 | EvenSpacing | 7.812500e-03, 1.138984e+00 | | 5 | 416 | 1 | 13 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.310789e-03 | Best Solution | ID | Memory (bits) | ConstraintMet | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) | | 5 | 416 | 1 | 13 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.310789e-03 | solution = FunctionApproximation.LUTSolution with properties ID: 5 Feasible: "true"
然后,您可以使用 approximate
方法来生成包含查找表逼近的子系统。
版本历史记录
在 R2018a 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)