Math Computations
Variables
Vectors and Matrices
Importing Data
2D Plots
100
What is the symbol for division in MATLAB?
/
100
What is pi in MATLAB?
100
What is a matrix?
A rectangular array of numbers, symbols, or expressions.
100
What type of file is accepted when you import the data in the file to MATLAB?
text file
100
What is the first step in creating a 2D plot of y=f(x) in MATLAB?
Define two vectors, x and y for the x and y coordinates of points on the curve.
200
What is the command for 3 times 5 in MATLAB?
3*5
200
How to define a variable in MATLAB?
Variable name = value or expression
200
Is the following MATLAB command correct in defining the row vector? v = (1,2,3)
No. v=[1,2,3]
200
What is the command to import data from a file to MATLAB?
load('filename.txt')
200
Is the following command correct in plotting y=f(x) in MATLAB? plot(y,x)
No, plot(x,y)
300
What is the command for square root of 9 in MATLAB?
sqrt(9)
300
Are x and X the same variables in MATLAB?
No.
300
According to the following MATLAB command, what will the vector be? x = 2:2:4
[2 4]
300
Will the following file be accepted by MATLAB? Time Temperature 0 50 1 55 2 60
No. The file should contain only numeric values - numbers
300
What is the command to label x axis on a 2D plot?
xlabel('x')
400
What is the command for natural logarithm of 5 in MATLAB?
log(5)
400
For the following MATLAB commands, what will z be? y=10 z=y^2
100
400
What is the result of the following MATLAB commands? A = [5 9 -2]; A(3)
-2
400
How to specify the color and the line style of a curve in MATLAB? For example, a magenta solid line?
plot(x,y,'m-')
500
What is the command for exponential of negative 10 in MATLAB?
exp(-10)
500
What will the semi-colon do in the following MATLAB command? c = 100;
To suppress the result and the result will not be shown in the command window.
500
How to access the 3rd row in a matrix C? What is the MATLAB command?
C(3,:)
500
How to plot two functions/curves on a single plot in MATLAB? What is the command? First function/curve: y1=f(x1) Second function/curve: y2=f(y2)
plot(x1,y1,x2,y2)