積分区間に変数を入れると計算できなくなります.なぜでしょうか?
Afficher commentaires plus anciens
%↑のMの値を求めることができるのですが,%↓のsの値は以下のようなエラーが発生してしまい計算することができません.
関数と積分範囲が異なるだけで,同様にプログラムを書いているはずなのですが,どこが原因なのでしょうか?
また,integralとquadの違いを調べたところ,評価がポイントになってくるみたいなのですが,わかりやすくご説明いただけないでしょうか.
editor
clear;
fun1 = @(l,t) (1-2./l./cos(t)).*sin(t);
tm = @(l) acos(2./l);
M = quad2d(fun1,2,4,0,tm)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fun2 = @(x,y) (1-2./(y.*x));
xk = @(y) 2.*y
s = quad2d(fun2,0,5,0,xk)
commandwindo
M =
0.1333
xk =
値をもつ function_handle:
@(y)2.*y
警告: 関数評価 (2000) の最大数に達しました。結果は大域的な誤差のテストをパスしませんでした。
> In quad2d (line 244)
In kesu (line 13)
Réponse acceptée
Plus de réponses (1)
ryohei yanagawa
le 22 Avr 2018
0 votes
Catégories
En savoir plus sur 数値積分と微分 dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!