Develop a program (M-File) called 'integrate' that will perform a first-order numerical approximation, yi(t), of the running integral with respect to time of an array of experimental data y(t). The M-File must also perform another first order approximation, yi2(t), of the first integral resulting in a double integration of the experimental data. A plot of y(t) must be generated on a single sheet of paper. On a second sheet of paper the functions yi(t) and yi2(t) must be plotted as two separate subplots, with the top half of the sheet containing the plot of yi(t) and the bottom half containing the plot of yi2(t). The inputs and outputs will be:

Inputs: A row vector with an arbitrary number of data points and the time step delta.

Outputs: A plot of the function y(t), a plot of the integral of the function yi(t), and a plot of the double integral yi2(t). To be plotted separately.

Using M-File:

(a) Run M-file and when asked for the input row vector enter 0:100, thich will generate a row vector with 100 entries. Use a delta of 0.01.

(b) Run M-file and when asked for the input row vector enter randn(1,101), which will generate a random vector with 100 entries. Use a delta of 0.01.

*Multiple graphs can be generated from the same M-File using the command 'figure' before each plot command.

Here is the code for the required program. I've included lots of commentaries because I believe that it can sometimes be quite difficult to understand a code written by another person. I hope this is clear enough.
clear all %
close all %Standard lines to clear variables and close graph windows

%Ask for data vector. For example: 0:100, or randn(1,101).
%Store it in x
x=input('Data ...

Solution Summary

This shows how to develop a Matlab program to perform first-order numerical approximation of a running integral.

Consider a finite-support signal
x(t) = t 0<=t<=1
and zero elsewhere.
- Using Matlab, plot x(t+1)
- Using Matlab, plot x(-t+1)
- Add the above two signals together and plot the new signal y(t).

Write the simplest possible one-dimensional "molecular dynamics code" for two particles?
I use MATLAB, so I want a MATLAB code for molecular dynamics or velocity verlet algorithm code.
I need to determinate x1, x2 and v1, v2 in different times.
Some websites may help you:
[http://www.nada.kth.se/~tomaso/miklab2007/lab2_4h

I need a detailed script in order to show this works in MATLAB.
----> Kernighan and Ritchie, who created the C language, advise that, "The first program to write in any language is the same for all languages: Print the words "hello, world". This is the basic hurdle; to leap over it you have to be able to create program tex

Hi, l want the Fourier series of this function by hand and using Matlab or any mathmatical program or programming language.
f (x) = 0, -π < x < 0
cos x 0 ≤ x < π
Find the Fourier series using Matlab?

Write the following MATLAB functions
(a) function l,u¸=naivege(a) that returns the lower triangular matrix L and an upper triangular matrix U such that A=LU, obtained by Gauss Elimination without pivoting.
(b) function x=utrisol(u,b) that solves the upper tridiagnonal system Ux=b using backward substitution.
(c) Function x=l

Hi,
I need help in using Matlab to build an m file for
solving non-linear equations using the Newton-Raphson
method (or another recommended method.) I need a clear
explanation of the process of creating an m file, and
also using it to find the roots of the following two
equations as examples:
1) f(x) = exp(-x) - sin(

1) G(s) =
Use Matlab and obtain Nyquist Plot
2) G(s) =
Kv1=0.325
Kv2=0.45
Note: K does not equal Kv
Determine the phase margin, gain margin, and closed-loop bandwidth for each case. Determine these both graphically, from the appropriate bode plots, and using the Matlab functions margin and bandwidth