Please answer ASAP!! Solve T4.6-2 from the Test Your Understanding Section, Palm
ID: 1862096 • Letter: P
Question
Please answer ASAP!!
Solve T4.6-2 from the Test Your Understanding Section, Palm p. 187 Given an independent variable x such that 0 le x le 5 in steps of 0.05; And given two functions y1 = e - degree.8x; and y2= sin (6x+3) You are required to write a MATLAB function to compute y3 = y1*y2; and y4=y2*y1; then use a combination of subplot and plot commands to generate four plots (in a 2 times 2 format as per illustrations in last lecture) on one page as follows: Plot of y1 versus x (use a red line) Superimposed plot of y1 versus x and y2 versus x. Hint, refer to the hold on command. Use a red line for y1 and a default line for y2 A plot of y3 versus x. Use a default line to plot. Comment on feature of plot in (b) and the plot in (c) Superimposed plot of y3 versus x (use a blue line) and y4 versus x. (use red dots). Comment on this plot. Any surprises? Get online help from MATLAB on effective use of hold on and hold off in dealing with question 2. Refer to table 5.2-1 page 228 plotting aids in MATLABExplanation / Answer
x = linspace(0,5,100);
y1 = exp(0.8x);
y2 = sin(6x+3);
plot(x,y1,"r");
hold on;
plot(x,y2);
y3 = y1.*y2;
plot(x,y3,"r");
hold on;
y4 = y2*.y1;
plot(x,y4,"b");
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.