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

The following command does what? () plot(x, sin(x), \'yp\') A. Plots sin(x) vs.

ID: 3110035 • Letter: T

Question

The following command does what? () plot(x, sin(x), 'yp') A. Plots sin(x) vs. x with a yellow plus sign marker and no line B. Plots sin(x) vs. x with yellow pentagram markers and no line C. Plots x vs. sin(x) with yellow plus sign markers and no line D. Plots x vs. sin(x) with yellow pentagram markers and no line How many times will a for loop starting with for = 1:3:19 execute (or repeat)? () A. 0 B. C. 6 D. 7 E. 19 Which one of the following commands plots a graph in the lower right comers of a 3 x 3 grid of graphs? () A. subplot(3, 3, 1) B. subplot(3, 3, 3) C. subplot(3, 3, 7) D. subplot(3, 3, 9) To evaluate the function y = 3x^3 - x^2 + x - 5 over a range of x = 1:100, with coef = [3.-1. -5], which command can you use? () A. polyval(coef, x) B. model(coef, x) C. polyfit(coef, x) D. linereg(coef, x) Which of the following is NOT a valid name for a function? () A. Poker B. Blackjack C. Solitare D. 52Card Pickup Which of the following commands plots r = sin(theta) in polar coordinates? () A. polar(theta, r); B. polar(r, theta) C. plot(theta, r) D. plot(r, theta)

Explanation / Answer

5. D

plot(x,y) is used to plot the x versus y graph. and plot(x,y,'y')  is used to plot the x versus y graph with yellow lines. and plot(x,y,'yp')  is used to plot the x versus y graph with yellow pentagram markers and no line. Therefore, plot(x,sin(x),'yp') plot the x versus sin(x) graph with yellow pentagram markers and no line.

6. D

for i : j : n . Here i is intial value, j is increment in i and n is last value. Therefore for 1:3:19 repeat 7 times. start from 1 then increment of 3 in each loop therefore move to 4 then move to 7 move to 10 move to 13 move to 16 move to 19 and loop end.

7. D

subplot(3,3,1) plots a graph in the upper left corner of 3x3 grid of graph.

subplot(3,3,3) plots a graph in the upper right corner of 3x3 grid of graph.

subplot(3,3,7) plots a graph in the lower left corner of 3x3 grid of graph.

subplot(3,3,9) plots a graph in the lower right corner of 3x3 grid of graph.

8. A

polyval(p,x) returns the value of a polynomial of degree n evaluated at x.

9. D

A valid variable name starts with a letter, followed by letters, digits, or underscores. It is case sensitive also therefore 'a' and 'A' is different. therefore, 52CardPickup is invalid name of function.

10. A

polar(theta,r) or polarplor(theta,r) used for plot in polar coordinate. If we use plot function then it will plot r = sin(theta) in cartesian coordinate.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote