What is the output of the following code? [code]t=linspace(0,3*pi);p=sin(t);y=cos(t);plot(t,p,t,q);[/code]

What is the output of the following code?
Code:
t=linspace(0,3*pi);p=sin(t);y=cos(t);plot(t,p,t,q);
A. Error
B. Multiple plots
C. A unit circle
D. A sinusoidal
 
Answer: b
Explanation: The plot command can be used to plot multiple graphs in a single window without using the hold command. The above code plots two sinusoidal curves from 0 to 3*pi. A unit circle would’ve been plotted if the plot command had only p and q as input.
 

Tìm kiếm

Back
Top