What is the output of the following code? [code]t=linspace(0:.1*pi:2*pi);plot(t,sin(t));text(0.5,1,’Ho !’,’colour’,’red’)[/code]

What is the output of the following code?
Code:
t=linspace(0:.1*pi:2*pi);plot(t,sin(t));text(0.5,1,’Ho !’,’colour’,’red’)
A. Error
B. A graph with Ho! written
C. A An inverted sinusoid
D. An inverted sinusoid with Ho written
 
Answer: a
Explanation: The text property added in the above code is ‘Colour’. This is the error, it should’ve been ‘color’. Then the output of the following code would’ve been A graph with Ho! written.
 

Tìm kiếm

Back
Top