2つの関数の積はどのようにして計算したらいいでしょうか
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
mushi77
am 29 Apr. 2021
Beantwortet: Hernia Baby
am 29 Apr. 2021
fx=sinx/xを0,Infで積分する計算を実行する際に、関数を変えて計算できるようにfx1=sinx, fx2=xとしてfx=fx1/fx2という計算式を間に入れたいです。
func1=@(x) sin(x);
func2=@(x) x;
と定義した関数を
func=func1 * func2
としてもエラーとなってしまうのですが、関数の積はどのように定義すればいいでしょうか。
0 Kommentare
Akzeptierte Antwort
Hernia Baby
am 29 Apr. 2021
シンボリック値で計算してはいかがでしょうか?
syms x;
func1 = x;
func2 = sin(x);
func = func2/func1;
% 数値を代入
y = subs(func,[0.1:0.1:1]);
% シンボリック値を数値へ
double(y)'
ans =
0.9983
0.9933
0.9851
0.9735
0.9589
0.9411
0.9203
0.8967
0.8704
0.8415
------------------------------------
本計算はSymbolic Math Toolboxが必要です
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 微積分 finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!