Quadratic and Trapizodial area

3 ビュー (過去 30 日間)
Raye
Raye 2013 年 3 月 14 日
The velocity of an object is V=t*sin(ct) c is a constant
So here how the program goes so far
x=t; t= 0:0.1:10; y= t.*sin(c.*t); for c = 0.1; A = trapz(x,y) end
Whenever I try more then one c it does give me both answers even if i do separate lines of code.
And quad(fun,a,b) has not been working well with the function y
c= 0.1 10*pi, 200

回答 (1 件)

Youssef  Khmou
Youssef Khmou 2013 年 3 月 14 日
A=zeros(3,1);
c=[0.1 10*pi 200];
t=0:0.1:10;
x=t;
for n=1:3
y=t.*sin(c(n)*t);
A(n)=trapz(x,y);
end % Results of the three integrals are stored in A

カテゴリ

Help Center および File ExchangePhysics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by