Integration with velocity trapezoidal and quadratic
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!