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

i have added all the pictures of all the files needed for this problem. please s

ID: 3590177 • Letter: I

Question












i have added all the pictures of all the files needed for this problem.
please solve the problem in Matlab

es tor xLetureeUser DashbLab 05 ve/folders/0B9GgSM1 JoViYV2t5X1FMZXdoMjg The name of your files must be exactly as specified in order to receive credit. Exercise 1: Plotting in MATLAB Download lab5_1.m and lab5_1 GNP.csv. The purpose of this exercise is to leam how to graph data from a csv file and plot multiple graphs on the same figure. You will be using plotting functions to plot four line plots and save part of your data to a .csv file Your final output should be a matilab figure with four graphs as shown below. Note: you may need to enlarge the figure window to duplicate the following display. Please submit lab5_1.m, lab5 1.csv, and lab5_1.png US GNP, 1947-2006 Graph of a Quadratic Function 15000 100 80 10000 60 40 5000 20 940 19019802000 024 6 80 Year Graph of a Square Root Function Graph of Two Functions H0 8 GNP data taken from MATLAB data examples MacBook Ai

Explanation / Answer

data=csvread('lab5_1_GNP.csv');
years=data(:,1);
GNP=data(:,2);
subplot(2,2,1)
plot(years,GNP)
xlabel('Year')
ylabel('Billion Dollars (2000)')
title('US GNP 1947-2005')
  

x1=(0:.01:10);
y1=x1.^2;
subplot(2,2,2)
plot(x1,y1,'r-o')
xlabel('x')
ylabel('y')
title('Graph of a Quadratic Function')


x2=(0:.01:10);
y2=sqrt(x2);
subplot(2,2,3)
plot(x2,y2,'g')
xlabel('x')
ylabel('y')
title('Graph of a Square Root Function')

subplot(2,2,4)
plot(x1,y1,x2,y2)
axis([0 10 0 5])
xlabel('x')
ylabel('y')
title('Graph of Two Functions')
legend('y=x^2','y=sqrt(x)')

y=[y1;y2]';
csvwrite('lab5_1.csv',y);
print('lab5_1.png','-dpng')