2つの関数の積はどのようにして計算したらいいでしょうか
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
mushi77
le 29 Avr 2021
Réponse apportée : Hernia Baby
le 29 Avr 2021
fx=sinx/xを0,Infで積分する計算を実行する際に、関数を変えて計算できるようにfx1=sinx, fx2=xとしてfx=fx1/fx2という計算式を間に入れたいです。
func1=@(x) sin(x);
func2=@(x) x;
と定義した関数を
func=func1 * func2
としてもエラーとなってしまうのですが、関数の積はどのように定義すればいいでしょうか。
0 commentaires
Réponse acceptée
Hernia Baby
le 29 Avr 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 微積分 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!