Matlab code that shows orthogonal functions

9 ビュー (過去 30 日間)
Taylor Stafford
Taylor Stafford 2020 年 11 月 8 日
回答済み: Mathieu NOE 2020 年 11 月 10 日
Is there a way to write a code in matlab to show that given functions are orthogonal? For example, I have to write a matlab code that shows f1(x)=x^3 and f2(x)=x^2+1 to be orthogonal from the indicated intervals of [-1,1].

回答 (1 件)

Mathieu NOE
Mathieu NOE 2020 年 11 月 10 日
hi
functions are orthogonal if the integral of the product of the two function is zero on the x range (specified)
if you have to do it analytically, make the product (it's a polynomial) , write the integral of it (still a polynomial) and check the value of this integral over the x range.
this can be also checked numerically (with some rounding error) by :
x = [-1:1e-3:1];
y1 = x.^3;
y2 = x.^2+1;
prod = sum(y1.*y2); % zero (almost)

カテゴリ

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