Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, I have a Matlab project to turn in but I missed a lab because I was sick so

ID: 2941052 • Letter: H

Question

Hi,
I have a Matlab project to turn in but I missed a lab because I was sick so I have no idea how to tackle this. it's a differential equation project:
I just need instruction or a step by step way on how to do this.
Thank you
Aby:


Consider the sDifferential equation:
y' = y + 2*cos(x) with initial condition y(0) = −2.

1. Solve it analytically using dsolve and get its particular solution.

2. Create a set of x1-values between 0 and 2, e.g. by using
x1 = 0:0.01:2;
Then use the analytic solution to get the corresponding y1-values.

3. Run euler_app.m with a poor resolution, n=10 subdivisions only.
This program prints in the output 10 pairs of x and y values.
Put all the x-values in an array called x2 and the y-values in an
array called y2.

4. Plot x1 vs. y1 as a continuous blue line. On the dame graph, punch
the 10 numerical points but paint them a different color, e.g. red.
An example of how this is done is shown in the help pages of Matlab.
The function that does this has the form:
plot ( x1, y1, .......
x2, y2, .......)

5. Name the axes of the graph as x and y. Also use the command "title" to print the analytic particular solution at the top of the graph, as well as your name.

Explanation / Answer

2.8 Extracting Bits of Matrices We may extract sections from a matrix in much the same way as for a vector. Each element of a matrix is indexed according to which row and column it belongs to. The entry in the ith row and jth column is denoted mathematically by Ai,j and, in MATLAB, by A (i, j). So >> J J = 1 2 3 4 5 6 7 8 9 10 11 12 20 0 5 4 >> J (1,1) ans = 1 >> J (2, 3) ans = 7 >> J (4, 3) ans = 5 >> J (4, 5) ??? Index exceeds matrix dimensions. >> J (4, 1) = J (1, 1) + 6 J = 1 2 3 4 5 6 7 8 9 10 11 12 7 0 5 4 >> J (1, 1) =J (1, 1) – 3 * J (1, 2) J = -5 2 3 4 5 6 7 8 9 10 11 12 7 0 5 4 In the following examples we extract ? 3rd column ? 2nd and 3rd columns ? 4th row ? “Central” 2 ×2 matrix >> J (:, 3) % 3rd column ans = 3

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote