Main Content

displayfeasiblesolutions

Class: FunctionApproximation.LUTSolution
Namespace: FunctionApproximation

Display all feasible solutions found during function approximation

Syntax

displayfeasiblesolutions(solution)

Description

displayfeasiblesolutions(solution) displays all feasible solutions found during the approximation process, including the best solution. Feasible solutions are defined as any solutions to the original FunctionApproximation.Problem object that met the constraints defined in the associated FunctionApproximation.Options object.

Input Arguments

expand all

FunctionApproximation.LUTSolution object from which to display all associated feasible solutions.

Examples

expand all

Create a FunctionApproximation.Problem object defining a math function to approximate. Then, use the solve method to get a FunctionApproximation.LUTSolution object.

Display all feasible solutions found during the approximation process using the displayfeasiblesolutions 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"
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 |

Version History

Introduced in R2018a