Write a MATLAB script file to solve y(t)=1.5e-3t cos(2t) using rectangular metho
ID: 3849905 • Letter: W
Question
Write a MATLAB script file to solve y(t)=1.5e-3t cos(2t) using rectangular method, meaning that use the formula of A_new=A_old+f(t_i)*dt. Your code must solve the integrations using all three methods of left sum, right sum and centered sum then display the answer to all three methods for the following points: t=0 to 8.0 with t=0.5. Compare your answers with solution of the function using “integral” command. Which rectangular method is closer to “integral” solution?-3t cos(2t) using rectangular method, meaning that use the formula of A_new=A_old+f(t_i)*dt. Your code must solve the integrations using all three methods of left sum, right sum and centered sum then display the answer to all three methods for the following points: t=0 to 8.0 with t=0.5. Compare your answers with solution of the function using “integral” command. Which rectangular method is closer to “integral” solution?
Hint: For solving this problem you need three “for” loops, the first one starts at “0” to calculate left-sum, the second one starts at 0.25 to calculate center-sum, and the last one starts at 0.5 to calculate right-sum (alternatively you can use one loop but o.25 and 0.5 should be added to the xi values for centered sum and right sum, respectively). Please make sure you use different counters for each loop (A_new=A_old+f(t_i)*dt). Also, for the first A_old since no value is available, use zero.
Explanation / Answer
rectangle('Position',pos)
rectangle('Position',pos,'Curvature',cur)
rectangle(___,Name,Value)
rectangle(ax,___)
r = rectangle(___)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.