We want to plot the function y = x2 over the interval [1.3). .n order to do this
ID: 3563186 • Letter: W
Question
We want to plot the function y = x2 over the interval [1.3). .n order to do this, we need to establish an x vector (our independent variable) and a y vector (our dependent variable). 1) Given x = [1:0.05:4 write the MATLAB code to generate our y vector (Hint: refer to the original function that we are trying to plot). 12) There are many different line specifications that can be used when plotting. Using the documentation at, answer the following questions: a) List 2 different line style specifiers, and the line style that they produce (e.g.. is the default solid line). b) List 2 different color style specifiers and the color they produce (e.g.. 'k' is used to specify black). c) List 2 different marker specifiers and the markers the produce (e.g., 'p' is used to specify pentagram markers) 3) Using your answers to questions 1 and 2, write the MATLAB code to plot y = x^2. Be sure to use some of the line specifications that you discussed for question 2.Explanation / Answer
subplot(2 2 1)
title('Plot without specifications')
subplot(2 2 2)
plot(x,y,'*') % we can use '-.' or '-o' to make different styles
title('Plot with line specification')
subplot(2 2 3)
plot(x,y,'r') %' r' is for red , 'g' is for green and 'y' is for yellow
title('plot with color specific')
subplot(2 2 4)
plot(x,y,'o') %'o' is for circle, 'd' is for diamond
title(' with specific')
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.