主要内容

displayfeasiblesolutions

显示在函数逼近期间找到的所有可行解

语法

displayfeasiblesolutions(solution)

说明

displayfeasiblesolutions(solution) 显示在逼近过程中找到的所有可行解,包括最优解。可行解定义为满足关联的 FunctionApproximation.Options 对象中定义的约束的原始 FunctionApproximation.Problem 对象的任何解。

输入参数

全部展开

要从中显示所有关联的可行解的 FunctionApproximation.LUTSolution 对象。

示例

全部展开

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

使用 displayfeasiblesolutions 方法显示在逼近过程中找到的所有可行解。

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"
displayfeasiblesolutions(solution)
|    ID |   Memory (bits) |   ConstraintMet |      Table Size | Breakpoints WLs |    TableData WL |   BreakpointSpecification |             Error(Max,Current) | 
|     2 |             864 |               1 |              52 |              16 |              16 |           EvenPow2Spacing |     7.812500e-03, 1.978726e-03 |
|     4 |             560 |               1 |              33 |              16 |              16 |               EvenSpacing |     7.812500e-03, 4.817965e-03 |
|     7 |             496 |               1 |              29 |              16 |              16 |               EvenSpacing |     7.812500e-03, 6.288182e-03 |
|     8 |             464 |               1 |              27 |              16 |              16 |               EvenSpacing |     7.812500e-03, 7.324035e-03 |
|    10 |             704 |               1 |              22 |              16 |              16 |            ExplicitValues |     7.812500e-03, 7.323370e-03 |

Best Solution
|    ID |   Memory (bits) |   ConstraintMet |      Table Size | Breakpoints WLs |    TableData WL |   BreakpointSpecification |             Error(Max,Current) |
|     8 |             464 |               1 |              27 |              16 |              16 |               EvenSpacing |     7.812500e-03, 7.324035e-03 |

版本历史记录

在 R2018a 中推出