integral of the squared error

10 ビュー (過去 30 日間)
dab483
dab483 2011 年 12 月 7 日
does anyone knows how can i code using matlab the integral of the squared error from time 0 to time=T.
Let say i have an error. e.

回答 (1 件)

Andrei Caragea
Andrei Caragea 2011 年 12 月 7 日
Let F be your initial function of time (as an example, let's say F(t)=t^2) and G be the approximation function (in this example let's say G(t)=sin(t)). Then you need to define the square difference function as a function handle: fh=@(t)(t.^2-sin(t)).^2 and you get the integral (meaning your error) with E=quad(fh,0,T).

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by