Numerical integration using a quad function
2 ビュー (過去 30 日間)
古いコメントを表示
I have created the following function
function x = rZSum(y, z)
y= load('delta.txt');
z = load('aSqr.txt');
x = y./z;
end
I would now like to use this function in numerical integration, evaluating it between 0 and 0.9999.
I have tried both
quad(rZSum,0,0.9999)
and
quadl(rZSum,0,0.9999)
with the same error being thrown up each time
Error using fcnchk (line 103)
FUN must be a function, a valid string expression, or an inline function object.
Would anyone be able to guide me on where I am going wrong, or what the error means? As integrating in matlab is new to me. Thank you in advanced!
4 件のコメント
Benjamin Avants
2014 年 5 月 15 日
I feel silly about not catching this earlier, but if you're still having problems, you need to change the definition of your function. Since you load y and z from inside the function, you need to remove them as parameters from the function definition.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!