Integration with velocity trapezoidal and quadratic

조회 수: 1 (최근 30일)
Raye
Raye 2013년 3월 14일
The velocity of an object is V=t*sin(ct). C is a constant. Use trapezoidal and quadratic integration to integrate this from t=0 to t=10. For trapezoidal, us spacing of 0.1. For c=0.1, c=10*pi, and c=200.
if true
% code
x = t;
t = 0:0.1:10;
y = t.*sin(c.*t);
for c = 0.1;
A = trapz(x,y)
A2= quad(fun(y),0,10)
end
end
my code just gives out on me after the first run and if I try to put another value for C besides the one listed it gives the one answer.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by