Main Content

# solutionfromID

クラス: FunctionApproximation.LUTSolution
パッケージ: FunctionApproximation

## 構文

```other_solution = solutionfromID(solution,id) ```

## 説明

`other_solution = solutionfromID(solution,id)` は、`FunctionApproximation.LUTSolution` オブジェクト `solution` に関連付けられている解を `id` で指定された ID とともに返します。

## 入力引数

すべて展開する

データ型: `double`

すべて展開する

## 例

すべて展開する

この例では、`FunctionApproximation.LUTSolution` オブジェクトの `solutionfromID` メソッドを使用して他の近似の解を確認する方法を示します。

`problem = FunctionApproximation.Problem('sin')`
```problem = 1x1 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: [1x1 FunctionApproximation.Options] ```
`solution = solve(problem)`
```Searching for fixed-point solutions. | ID | Memory (bits) | Feasible | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) | | 0 | 64 | 0 | 2 | 16 | 16 | EvenSpacing | 7.812500e-03, 1.000000e+00 | | 1 | 784 | 1 | 47 | 16 | 16 | EvenSpacing | 7.812500e-03, 5.388912e-03 | | 2 | 768 | 1 | 46 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.534419e-03 | | 3 | 608 | 1 | 36 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.089765e-03 | | 4 | 592 | 1 | 35 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.272461e-03 | | 5 | 416 | 1 | 24 | 16 | 16 | EvenSpacing | 7.812500e-03, 6.201693e-03 | | 6 | 400 | 1 | 23 | 16 | 16 | EvenSpacing | 7.812500e-03, 6.836819e-03 | | 7 | 224 | 0 | 12 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.013411e-02 | | 8 | 304 | 0 | 17 | 16 | 16 | EvenSpacing | 7.812500e-03, 1.887217e-02 | | 9 | 352 | 1 | 20 | 16 | 16 | EvenSpacing | 7.812500e-03, 7.807773e-03 | | 10 | 320 | 0 | 18 | 16 | 16 | EvenSpacing | 7.812500e-03, 1.695679e-02 | | 11 | 336 | 1 | 19 | 16 | 16 | EvenSpacing | 7.812500e-03, 7.810061e-03 | | 12 | 64 | 0 | 2 | 16 | 16 | EvenPow2Spacing | 7.812500e-03, 1.315166e+00 | | 13 | 576 | 1 | 18 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.803448e-03 | | 14 | 512 | 0 | 16 | 16 | 16 | ExplicitValues | 7.812500e-03, 1.190175e-02 | | 15 | 576 | 1 | 18 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.803448e-03 | Best Solution | ID | Memory (bits) | Feasible | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) | | 11 | 336 | 1 | 19 | 16 | 16 | EvenSpacing | 7.812500e-03, 7.810061e-03 | ```
```solution = 1x1 FunctionApproximation.LUTSolution with properties: ID: 11 Feasible: "true" ```

`displayfeasiblesolutions(solution)`
```| ID | Memory (bits) | Feasible | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) | | 1 | 784 | 1 | 47 | 16 | 16 | EvenSpacing | 7.812500e-03, 5.388912e-03 | | 2 | 768 | 1 | 46 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.534419e-03 | | 3 | 608 | 1 | 36 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.089765e-03 | | 4 | 592 | 1 | 35 | 16 | 16 | EvenSpacing | 7.812500e-03, 4.272461e-03 | | 5 | 416 | 1 | 24 | 16 | 16 | EvenSpacing | 7.812500e-03, 6.201693e-03 | | 6 | 400 | 1 | 23 | 16 | 16 | EvenSpacing | 7.812500e-03, 6.836819e-03 | | 9 | 352 | 1 | 20 | 16 | 16 | EvenSpacing | 7.812500e-03, 7.807773e-03 | | 11 | 336 | 1 | 19 | 16 | 16 | EvenSpacing | 7.812500e-03, 7.810061e-03 | | 13 | 576 | 1 | 18 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.803448e-03 | | 15 | 576 | 1 | 18 | 16 | 16 | ExplicitValues | 7.812500e-03, 7.803448e-03 | Best Solution | ID | Memory (bits) | Feasible | Table Size | Breakpoints WLs | TableData WL | BreakpointSpecification | Error(Max,Current) | | 11 | 336 | 1 | 19 | 16 | 16 | EvenSpacing | 7.812500e-03, 7.810061e-03 | ```

このテーブルで ID 5 の解が実行可能解として表示されません。この解を調べて実行可能でない理由を確認します。

`solution5 = solutionfromID(solution, 5)`
```solution5 = 1x1 FunctionApproximation.LUTSolution with properties: ID: 5 Feasible: "true" ```

ID 5 の解の数値的動作を比較します。

`compare(solution5)`

```ans = struct with fields: Breakpoints: [51473x1 double] Original: [51473x1 double] Approximate: [51473x1 double] ```

R2018a で導入