MATLAB Code:
close all
clear
clc
a = 0; b = pi; % integration limits
%% n = 100
n = 100;
func = @(x) sin(sqrt(x)) .* cos(sqrt(x)); % input function
h = (b - a)/n;
I = h*sum(func(a + h/2:h:b-h/2)); % Riemann sum using midpoint
rule
fprintf('Riemann Sum (n = %4d): %.6f\n', n, I)
%% n = 300
n = 300;
func = @(x) sin(sqrt(x)) .* cos(sqrt(x)); % input function
h = (b - a)/n;
I = h*sum(func(a + h/2:h:b-h/2)); % Riemann sum using midpoint
rule
fprintf('Riemann Sum (n = %4d): %.6f\n', n, I)
Output:
Riemann Sum (n = 100): 0.717351
Riemann Sum (n = 300): 0.717069
please explain and do in matlab Problem 6. Consider the definite integral fo, sin(VE) cos( dz. Use n-100 and n = 300 separately, to find the Riemann sum for this integral. Keep at least four decim...
this is matlab problem Problem 1. Use the graphical approach to investigate the limit of f(x) as r goes to +oo. Keep your answer at least three decimal places and include the commands y Problem 2. Consider the function f(x) -e sin(2r) (1) Sketch its graph over the interval [0, ] by the following commands: Problem 1. Use the graphical approach to investigate the limit of f(x) as r goes to +oo. Keep your answer at least three decimal places...
1199031 Consider the following series 1 (a) Use a graphing utility to graph several partial suns of the series. 6 n-1 n-6 -3 (b) Find the sum of the series and its radius of convergence. (e) Use a graphing utility and 50 terms of the serles to approximate the sum when x -0.5. (Round your answer to six decimal (d) Determine what the approximation represents. The sum from part (c) is an approximation of In(0.3) Determine how good the approximation...
Question 1 QUESTION 2 Use the attached Matlab code as a basis to solve the following ordinary differential equation using Euler's method, with timestep of 0.1, from t-0to t-100. d)0) -0 - sin (5vt cos(у Plot y versus t from t=0 to t=100. How many local maxima are on this interval(do not include end points). Be careful to count them all! Answer should be an integer 1 w% Matlab code for the solution of Module 2 3 dt-9.1; %dt is...