Notice You have to use this program to answer MATLAB R2012b Must be a pdf includ
ID: 2081598 • Letter: N
Question
Notice You have to use this program to answer MATLAB R2012b
Must be a pdf
include: Question, Matlab code, and Answer for all questions
Basic Plot Video:
https://www.mathworks.com/videos/using-basic-plotting-functions-69018.html
Using fplot Video
https://www.youtube.com/watch?v=EpiTzgcWfIw
tons of other videos if you are having issues.
Part I: Graphing (Plot)
Generate a series x with values ranging from 1 to 6 in increments of 1. To do this type in >>x=[1 2 3 4 5 6] or x=[1:6]
Generate a series y with values ranging from 2 to 4.5 in increments of .5 To do this you can type in >>y=[2 2.5 3 3.5 4 4.5] or y=[2:0.5:4.5]
1. Make an xy linear plot. Label axes, add title include this plot to your word document.
2. Make an xy linear plot again. Each point should be represented by the symbol "o". Label axes, add titles, include this plot to your word document.
3. Change the axis on your plot such that x goes from -1 to 7 and y goes from 1.5 to 5. (use the axis command (zooms like google earth)) Add a grid to this plot. Label axes, add titles, include this plot to your word document.
Part II: Graphing fplot
Use fpot to plot f(x) from -10 to 10
f(x)=x^2-x+1/x^2+x+1
Include labels and titles, save this plot to your word document.
2) Use fplot to plot f(x)
f(x)= 0.01 x^5 -0.03x^4+0.4 x^3 -2x^2 -6x+5
Include labels and titles, save this plot to your word document.
Part III: Pie Plots
1) Here is the grade breakdown for ECON 202
10 students ‘A’
15 students ‘B’
22 students ‘C’
9 students ‘D’
4 students ‘F’
Make a pie chart for the above data. Include labels, title, and section of the pie
Explanation / Answer
Part I: Graphing (Plot)
Solution:
%matlab code
x=[1:6];
y=[2:0.5:4.5];
plot(x,y)
title('xy linear plot')
xlabel('x-axis') % x-axis label
ylabel('y-axis') % y-axis label
2.Make an xy linear plot again. Each point should be represented by the symbol "o". Label axes, add titles, include this plot to your word document.
Solution:
%matlab code
x=[1:6];
y=[2:0.5:4.5];
plot(x,y,'-o')
title('xy linear plot')
xlabel('x-axis') % x-axis label
ylabel('y-axis') % y-axis label
Solution:
%matlab code
x=[1:6];
y=[2:0.5:4.5];
plot(x,y,'-o')
title('xy linear plot')
grid on
axis([-1 7 1.5 5])%axis([XMIN XMAX YMIN YMAX])
xlabel('x-axis') % x-axis label
ylabel('y-axis') % y-axis label
Part II: Graphing fplot
Use fpot to plot f(x) from -10 to 10
f(x)=x^2-x+1/x^2+x+1
Include labels and titles, save this plot to your word document.
Solution:
%matlab code
fplot(@(x) x^2-x+1/x^2+x+1,[-10 10])
title('fplot')
xlabel('x-axis')
ylabel('y-axis')
2) Use fplot to plot f(x)
f(x)= 0.01 x^5 -0.03x^4+0.4 x^3 -2x^2 -6x+5
Include labels and titles, save this plot to your word document.
Solution:
%matlab code
f=@(x) 0.01*x^5 -0.03*x^4+0.4*x^3 -2*x^2-6*x+5
fplot(f,[-10 10])
title('fplot')
xlabel('x-axis')
ylabel('y-axis')
Part III: Pie Plots
1) Here is the grade breakdown for ECON 202
10 students ‘A’
15 students ‘B’
22 students ‘C’
9 students ‘D’
4 students ‘F’
Make a pie chart for the above data. Include labels, title, and section of the pie
%matlab code
x=[10 15 22 9 4];
labels = {'A','B','C','D','F'};
explode=[10 15 22 9 4];
pie(x,explode,labels)
title('ECON 202');
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.