What is the output of the following code? [code]t=linspace(0,.00002*pi,2*pi);plot(t,cos(t));text(0.5,1,'color','blue')[/code]

Trương Duy

New member
What is the output of the following code?
Code:
t=linspace(0,.00002*pi,2*pi);plot(t,cos(t));text(0.5,1,'color','blue')
A. Syntactical Error due to text command
B. Input error due to text command
C. Error in linspace command
D. A graph of sinusoid with Ho ! written on it
 
Answer: a
Explanation: We haven’t given any string input to the text command which we want to show in the graph. Hence, MATLAB will send an error due to the text command. The rest of the code is okay.
 

Tìm kiếm

Back
Top