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
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')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.