# Matlab Programming

Not what you're looking for?

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.

##### Purchase this Solution

##### Solution Summary

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

##### Solution Preview

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 ...

##### Purchase this Solution

##### Free BrainMass Quizzes

##### Multiplying Complex Numbers

This is a short quiz to check your understanding of multiplication of complex numbers in rectangular form.

##### Know Your Linear Equations

Each question is a choice-summary multiple choice question that will present you with a linear equation and then make 4 statements about that equation. You must determine which of the 4 statements are true (if any) in regards to the equation.

##### Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.

##### Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.

##### Solving quadratic inequalities

This quiz test you on how well you are familiar with solving quadratic inequalities.