Use matlab to write this script Question 1 (10 Points) Write a MATLAB function t
ID: 2248360 • Letter: U
Question
Use matlab to write this script
Explanation / Answer
clc; clear all; close all; f=@(x)1/(1+x); %Change here for different function a=0;b=6; %Given limits n=b-a; %Number of intervals h=(b-a)/n; p=0; for i=a:b p=p+1; x(p)=i; y(p)=1/(1+i); %Change here for different function end l=length(x); x y answer=(h/2)*((y(1)+y(l))+2*(sum(y)-y(1)-y(l)))
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.