What is the output of the following command? [code] >> x={1 2 3}; >> t=[1 2 3]; >> plot(x,t)[/code]

What is the output of the following command?
Code:
>> x={1 2 3};
>> t=[1 2 3];
>> plot(x,t)
A. plots a ramp function
B. plots r(t)-r(t-3)
C. Error due to plot
D. Error due to x
 
Answer: d
Explanation: In the above code, x is a cellular array. It will create an error in the working of the plot command since the plot command cannot plot values in cellular arrays. Hence, there is a syntactical error while defining x for the plot command.
 

Tìm kiếm

Back
Top