1.

A student has created a plot of y(t)=t^2. He is need to show another graph of z(t)=t^3 in the same plot. But every time he hits the plot() function- MATLAB generates a plot of z(t) vs t but on a different window. What is the error?(a) It is not possible to plot multiple plots(b) He is not using the line function(c) Maybe he is using stem() instead of plot()(d) He is not using the hold functionI have been asked this question during an interview.Question is from Plotting Multiple Curves topic in portion MATLAB Basics of MATLAB

Answer»

The correct option is (d) He is not using the hold function

For explanation I would say: The hold command is used to hold the cursor, DEVELOPED after creating a plot, so that the NEXT GRAPH, when PLOTTED, will appear on the same window where the initial graph was plotted. He may use the line function, but in the code he is using the plot function. So he has to enter the function hold before PLOTTING the graph of z(t).



Discussion

No Comment Found

Related InterviewSolutions