Find the error in the following code. [code]x=-10:1:10; y=-10:2:10; plot(x,y)[/code]

Pham Quỳnh

New member
Find the error in the following code.
Code:
x=-10:1:10; y=-10:2:10; plot(x,y)
A. Plot is not available in MATLAB
B. Syntax of plot is wrong
C. Length of x and y should be same
D. No error
 
Answer: c
Explanation: It is highly important that the length of the variables, between which we need to plot a graph, be same. This is a pre-defined syntax of MATLAB so MATLAB will return an error if the lengths are not same.
 

Tìm kiếm

Back
Top