Integration help (quad)
2 ビュー (過去 30 日間)
古いコメントを表示
New to Matlab and stuck trying to integrate trigXtrig function.
Here's what I've been doing:
function y=rfun(theta)
y=(cos(theta).*sin(theta).);
end
EDU>> q=quad('rfun',0,0.644)
But I get this error:
Error in ==> quad at 77
y = f(x, varargin{:});
1 件のコメント
John D'Errico
2011 年 4 月 8 日
So what error did you get???? You only wrote part of the error here, the part that gives insufficient information!
採用された回答
Matt Fig
2011 年 4 月 8 日
Why not use an anonymous function instead?
>> y = @(th) cos(th).*sin(th); % The function to integrate...
>> q = quad(y,0,0.644) % Also, quadl(y,0,0.644)
0 件のコメント
その他の回答 (2 件)
Friedrich
2011 年 4 月 8 日
Hi Jeffrey,
I think you get this error because of the extra dot after sin(theta). You function rfun should look like this:
function y=rfun(theta)
y=(cos(theta).*sin(theta));
end
I hope I could help, Friedrich
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Pole and Zero Locations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!