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

Which of the following will plot a set of ordered pairs as individual points, th

ID: 3850710 • Letter: W

Question

Which of the following will plot a set of ordered pairs as individual points, then plots the best fit first degree polynomial line for the data on top of the points? Plot(X, Y, 'r*'): hold on p = polyfit(X, Y): plot(X, poly(p, X), 'b-'): hold off Plot(X, Y, 'r*'): hold on p = poly (X, Y, 1): plot(X, polyval(p, X), 'b-'): hold off Plot(X, Y, 'r*'): hold on p = polyfit(X, Y, 1): plot(X, poly(p, X), 'b-'): hold off Plot(X, Y, 'r*'): hold on p = poly (X, Y, 1): plot(X, polyval(p, X), 'b-'): hold off None of the above A run time error is when the program a particular statement has an error that keeps that statement from ever running. all statements can run but sometimes encounter a error that causes the program to exit. all statements can run but the program returns an incorrect action or result the program causes the computer to freeze forcing a hard reboot none of the above A recursion error is when the program a particular statement has an error that keeps that statement from ever running. all statements can run but sometimes encounter a error that causes the program to exit all statements can run but the program returns an incorrect action or result the program causes the computer to freeze forcing a hard reboot none of the above The MatLab code that will create a 2x5 matrix with the elements ordered from 1 is x = ones (2, 5): x = matrixspace(2, 5): x = linspace(2, 5, 10): x = [linespace(1, 5, 5): linspace(6, 10, 5)]: None of the above How many elements are in the vector x = [3: 0.7: 9]? 7 9 10 14 None of the above

Explanation / Answer

16. Ans(C).

Explanation : Polyfit(x,y,n) returns the coefficients for a polynomial p(x) of degree n that is a best fit (in a least-squares sense) for the data in y. In all of the examples, only two have the function polyfit and only one has passed 3 arguments to polyfit, hence that is the answer.

17. Ans(B)
Explanation: A runtime error is an error that is detected while the program is run because the code is logically correct. The program runs the code first and returns a run time error if it finds that the code cannot run.

18. Ans(A)
Explanation: A recursion error is when there is too much or inifinite recursion. This causes the code to show a recursion error.

19. Ans(A)
Explanation: ones(x,y) function sets the values of a x X y matrix to 1's.

20. Ans(B)
Explanation: x=[3:0.7:9] creates a matrix from 3 to 9 evenly spaced by 0.7

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