Main Content

displayallsolutions

Class: FunctionApproximation.LUTSolution
Namespace: FunctionApproximation

Display all solutions found during function approximation

Syntax

displayallsolutions(solution)

Description

displayallsolutions(solution) displays all solutions, including the non-feasible solutions, associated with a FunctionApproximation.LUTSolution object.

Input Arguments

expand all

FunctionApproximation.LUTSolution object from which to display all associated 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 solutions found during the approximation process using the displayallsolutions 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"
displayallsolutions(solution)
|    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.590463e+00 |
|     1 |             464 |               0 |              27 |              16 |              16 |           EvenPow2Spacing |     7.812500e-03, 7.823061e-03 |
|     2 |             864 |               1 |              52 |              16 |              16 |           EvenPow2Spacing |     7.812500e-03, 1.978726e-03 |
|     3 |              64 |               0 |               2 |              16 |              16 |               EvenSpacing |     7.812500e-03, 1.000000e+00 |
|     4 |             560 |               1 |              33 |              16 |              16 |               EvenSpacing |     7.812500e-03, 4.817965e-03 |
|     5 |             304 |               0 |              17 |              16 |              16 |               EvenSpacing |     7.812500e-03, 1.887217e-02 |
|     6 |             432 |               0 |              25 |              16 |              16 |               EvenSpacing |     7.812500e-03, 8.513680e-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 |
|     9 |             448 |               0 |              26 |              16 |              16 |               EvenSpacing |     7.812500e-03, 7.895832e-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