Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

getErrorValue

クラス: FunctionApproximation.LUTSolution
名前空間: FunctionApproximation

ルックアップ テーブル近似の誤差の合計の取得

構文

memory = getErrorValue(solution)

説明

memory = getErrorValue(solution) は、solution で指定されたルックアップ テーブル近似の誤差の合計を返します。

入力引数

すべて展開する

誤差を取得する解。FunctionApproximation.LUTSolution オブジェクトとして指定します。

出力引数

すべて展開する

ルックアップ テーブル近似の誤差の合計。struct として返されます。

struct には 2 つのフィールドが含まれています。MaxErrorInSolution フィールドは、元の関数またはブロックとルックアップ テーブル近似との最大差異を指定します。ErrorUpperBound フィールドは、FunctionApproximation.Options オブジェクトについて指定された許容誤差に従って、受容可能な最大誤差を表示します。

すべて展開する

近似する数学関数を定義する FunctionApproximation.Problem オブジェクトを作成します。その後、solve メソッドを使用して FunctionApproximation.LUTSolution オブジェクトを取得します。

getErrorValue メソッドを使用して FunctionApproximation.LUTSolution オブジェクトの合計誤差を計算します。

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"
error = getErrorValue(solution)
error = 

  struct with fields:

    MaxErrorInSolution: 0.0073
       ErrorUpperBound: 0.0078

バージョン履歴

R2019a で導入