How do I integrate a very simple function with specified inputs?
古いコメントを表示
What I want to do is very simple, and so I am very frustrated. I simply want to integrate a function of multiple variables, i.e. a function with inputs (arrays) to be specified, say, a function involving a variable to be integrated over, x, and inputs, like a and b::
quad('a.*x - b',0,10)
I continue receiving this error message:
??? Error using ==> inline.subsref at 14
Not enough inputs to inline function.
My actual code is below
global a b
a = 1; b = 2;
integrand = inline('(x.^3-a*x-b)','a','b');
quad(integrand,-5,5)
I've tried everything I can think of, and making it as simple as possible, as you can tell. What am I doing wrong?
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Function Creation についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!