What is the output of the following code? [code]plot([-5:1:5],tripuls([-4:1:4])[/code]

Đạt Michio

New member
What is the output of the following code?
Code:
plot([-5:1:5],tripuls([-4:1:4])
A. Error
B. Generates a triangular pulse signal
C. Generates a sawtooth signal
D. Cannot be determined
 
Answer: a
Explanation: The length of the first vector given as an input to the plot command is not equal to the length of the second vector given as an input. Hence, the above code will result in an error. If the first vector was ranging from [-4:1:4], the output would’ve been Generates a triangular pulse signal only.
 

Tìm kiếm

Back
Top