What is the output of the following code? [code]w=[0:.1*pi:2*pi];plot(w,sin(w),’ ’)[/code]

What is the output of the following code?
Code:
w=[0:.1*pi:2*pi];plot(w,sin(w),’ ’)
A. A sinusoid
B. A blank graph
C. Error in plot command
D. A sinusoid with a phase difference
 
Answer: a
Explanation: The output of the above code will only be a sinusoid. The input to within the ‘’ is empty so the default style of plotting with – will be used by the plot command.
 

Tìm kiếm

Back
Top