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

In this exercise, you will create a function trough_plot which will plot the cro

ID: 3111936 • Letter: I

Question

In this exercise, you will create a function trough_plot which will plot the cross-section of a trough outlines by the functions y0 and y. Input variables: x - a vector representing the x co-ordinates for the outline of the trough. y - a vector representing the y co-ordinates for the bottom of the trough. y0 - a vector representing the y co-ordinates for the top of the trough. Output variable: n/a this function has no output variables. The plots for y and y0 must be in the same figure, with the order below being strictly adhered to. Graph the bottom of the trough (y) The curve should be displayed using a black dashed line with a line width of 5. On the same set of axes as the first curve, graph the top of the trough (y1). The curve should be displayed using a cyan dotted line with a line width of 4. Potentially Useful Functions: plot, hold Function Template: function trough_plot (x, y, y0) % INSERT_CODE_HERE end Submitted file: function trough_plot(x, y, y0) % INSERT_CODE_HERE end

Explanation / Answer

%%%%%%%%%%% function code

function [] = trough_plot(x,y,y0)
figure;
plot(x,y,'k--','LineWidth',5);
hold on
plot(x,y0,'c:','LineWidth',4);

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