`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc%clears screen
clear all%clears history
close all%closes all files
x1=linspace(0,pi,100);
x2=linspace(0,pi,1000);
y1=sin(2*x1);
y2=sin(2*x2);
Ia1=2*cos(2*x1);
Ia2=2*cos(2*x1);
disp('Integral for first');
I1=cumtrapz(x1,y1)
disp('Integral for second');
I2=cumtrapz(x2,y2)
disp('Max error is first is');
max(abs(I1(:)-Ia1(:)))
disp('Max error is second is');
max(abs(I2(:)-Ia2(:)))
plot(x2,I2);
title('Plot for 1000 points');
Kindly revert for any queries
Thanks.
Create two vectors with entries evenly spaced between 0 and pi. One vector should be of...
My code for calculating the
first derivative is the second image
Compute second derivative O solutions submitted (max: 10) You are provided with a set of data for the position of an object over time. The data is sampled at evenly spaced time intervals. Your task is to find a second order accurate approximation for the acceleration at each point in time. Write a Matlab function that takes in a vector of positions x, the time interval between each sampled...