Quiz: Assignment 1
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Assignment 1
Started: Jan 23 at 4:23pm
Quiz Instructions
This assignment tests your knowledge of Basic Operations in Matlab. The total number of points for this quiz is 100.
Address short answer grading questions to: Q14-16 :Lingyu ; Q 17: Shaida
Question 1
Which command is used to clear the command window?
clear
clc
home
clrcmd
Question 2
Using the Help System (type "doc" in command window), try to find the answer to the following question. What is the Matlab command that can be used to create a scatter plot?
whos
lsline
scatter
size
Question 3
Using the Help System, try to find the answer to the following question. What does the Matlab command "floor" do?
Round toward infinity
Round toward negative infinity
Creates a reference line at the bottom of plot
Lists the smallest elements in array
Question 4
The number of elements in a vector generated by [5:0.5:8] is
8
7
6
5
Question 5
In the command window, if we enter
a=24;
a=217;
a
then the output shown by Matlab is:
Undefined function or variable 'a'.
a=24
a=NaN
a=217
Question 6
A correct name for a variable is
1arearec
area rec
area_rec
$arearec
Question 7
An incorrect name for a variable is
cat1
cat_1
cat_cos
1cat
Question 8
The Matlab command that outputs the number of rows and columns of a matrix is
dimensions
length
msize
size
Question 9
When inputting a matrix, each new row is separated by a
:
;
|
,
Question 10
Which statement will generate the matrix as shown below?
[ 1 5 8 3, 6 6 7 1, 0 1 0 8]
[ 1 5 8 3; 6 6 7 1; 0 1 0 8]
( 1 5 8 3; 6 6 7 1; 0 1 0 8)
[ 1 6 0; 5 6 1; 8 7 0; 3 1 8 ]
Question 11
Which command sequence leads to the pictured matrix being printed in the Command Window?
a=[0 8 3;3 5 5]; b=a'; b(1,:)=NaN; [a b]
a=[0 8 3;3 5 5]; b=transpond(a); b(1,:)=[]; [a b]
a=[0 8 3;3 5 5]; b=a'; b(1,:)=[]; [a b]
a=[0 8 3;3 5 5]; b=a'; b=b(2:3,:); [a; b]
Question 12
Which code represents the shown formula?
y = 2*exp(-t/tau)/sqrt(x+1*x-1)
y = 2*exp(-t/tau)/sqrt((x+1)*(x-1))
y = 2(exp(-t/tau)/sqrt((x+1)*(x-1)))
y = 2*e^(-t/tau)/sqrt((x+1)*(x-1))
Question 13
In order to multiply two matrices A and B as A * B (i.e., not using element-by-element multiplication)
the number of columns of A has to be the same as number of rows of B
the number rows of A has to be same as number of columns of B
both matrices need to be square
[B] [A] also needs to be possible
Enter the following matrix in Matlab:
x = [ 6 2 8 7; 3 5 6 0 ]
Please answer the following questions
Question 14
What matlab command do you use to extract the second row? ("extract" here means to reference or retrieve, not delete)
Question 15
What Matlab command do you use to extract the third column?
Question 16
What Matlab command do you use to delete the last column?
Question 17
Explain what happens when you enter x(:) in the command window. What is the colon operator doing in this case?
2024-01-24