Chapter 0 Getting into MATLAB

Class Quiz

1、单选题:
‍The word MATLAB comes from the abbreviations of (    ).‍
选项:
A: Mathematica Laboratory
B: Matrix Laboratory
C: MathWorks Lab
D: Matrices Lab
答案: 【 Matrix Laboratory

2、单选题:
‍Among the following options, one that reflects the characteristics of MATLAB is (    ).​
选项:
A: optimal algorithm
B: There is no need to write programs
C: High efficiency in program execution
D: High programming efficiency
答案: 【 High programming efficiency

3、判断题:
‎Scientific computing is the third scientific research method after scientific experiment and theoretical research.‍
选项:
A: 正确
B: 错误
答案: 【 正确

4、判断题:
‏There is no need for any numerical computing method when using MATLAB to solve problems in scientific computing.‏
选项:
A: 正确
B: 错误
答案: 【 错误

Chapter 1 Basic Knowledge of MATLAB

Class Quiz

1、单选题:
​When entering a string, enclose the sequence of characters with (    ).‎
选项:
A:  [ ]
B: { }
C:  ' '
D:  " "
答案: 【  ' '

2、单选题:
‍It is known that ch=['abcdef ';'123456'], then the character represented by ch(2,4) is (    ).​
选项:
A: 4
B: 3
C: c
D: d
答案: 【 4

3、单选题:
‍The result of the expression 'www0'>='W123' is (    ).‍
选项:
A: 1 1 0 0
B: 1 1 1 0
C: 1 0 0 0
D: 0 0 0 1
答案: 【 1 1 1 0

4、单选题:
‌The value of eval('sqrt(4)+2') is (    ).‍
选项:
A:  sqrt(4)+2
B: 4
C: 2
D: 2, 2
答案: 【 4

Unit Test 1

1、单选题:
‌When executing a command in command window, if you do not want to output the result immediately in the command window, you can add (    ).​
选项:
A: colon (:)
B: comma (,)
C: semicolon (;)
D: percent (%)
答案: 【 semicolon (;)

2、单选题:
‏The value of the expression fix(exp(1))+mod(264,10)*10 is (    ). ‍
选项:
A: 86
B: 62
C: 423
D: 42
答案: 【 42

3、单选题:
​After the following command is executed, the value of x is (    ). >> clear
>> 5i;
>> ans*j‏
选项:
A: 5i
B: -5
C: 5
D: 5i*j
答案: 【 -5

4、单选题:
‌The statement x=linspace(1,10,6) will generate a vector of (    ) elements. ‏
选项:
A: 1
B: 5
C: 6
D: 10
答案: 【 6

5、单选题:
‎The result of function floor(-2.1) is (    ). ‍
选项:
A: -3
B: -2
C: 1
D: 2
答案: 【 -3

6、单选题:
​The format option that would result in the following output format is (    ).>> 2/5 + 3/11
ans =
      37/55‏
选项:
A: long
B: short
C: hex
D: rat
答案: 【 rat

7、单选题:
​If it is known that A is a 3×5 matrix, after executing A(:,1:2:3)=[], (    ). ​
选项:
A: A becomes row vector
B: A becomes 3 rows and 3 columns
C: A becomes 3 rows and 2 columns
D: A becomes 2 rows and 3 columns
答案: 【 A becomes 3 rows and 3 columns

8、单选题:
‌Input the following command in command window:>> A=[1:3;4:6];
>> D=sub2ind(size(A),[1,1],[2,3])The value of D is(      )。‍
选项:
A: 3  6
B: 2  5
C: 4  5
D: 3  5
答案: 【 3  5

9、多选题:
​If the fpp.m file exists in both the current folder and search path, the wrong options in the following statement are (    ) when entering fpp in the command window.‌
选项:
A: execute the fpp.m file in the search path at first, then execute the fpp.m file in the current folder
B: only execute the fpp.m file in search path
C: executes the fpp.m file of the current folder at first, then execute the fpp.m file in the search path
D: only execute fpp.m file in current folder
答案: 【 execute the fpp.m file in the search path at first, then execute the fpp.m file in the current folder;
only execute the fpp.m file in search path;
executes the fpp.m file of the current folder at first, then execute the fpp.m file in the search path

10、多选题:

‎The MATLAB expression for the following mathematical expression are (    ).

‎(Here π and e are all mathematical constants.)

‎选项:
A: pi-exp(pi)
B: pi-power(exp(1),pi)
C: pi-e^pi
D: pi-exp(1)^pi
答案: 【 pi-exp(pi);
pi-power(exp(1),pi);
pi-exp(1)^pi

11、判断题:
​When x = 0.1, 0.3, 0.5, 0.7, 0.9, use the following expression to find the value of y = sin‍‍‍‍‍x cos‍x respectively.>> x=0.1:0.2:0.9;
>> y=sin(x)*cos(x);‌
选项:
A: 正确
B: 错误
答案: 【 错误

12、判断题:
‍The format command not only affects the data output format, but also affects the calculation and storage of data. ‎
选项:
A: 正确
B: 错误
答案: 【 错误

13、判断题:
‎In a matrix A with 3 rows and 3 columns, A(4) represents the element in the second row and the first column of matrix A.‎
选项:
A: 正确
B: 错误
答案: 【 错误

14、判断题:
‎The value of expression ~(5|3) is not equal to the value of expression ~5|3.‏
选项:
A: 正确
B: 错误
答案: 【 正确

Chapter 10 External Program Interfaces

Class Quiz

1、单选题:
‎As for the MATLAB engine, the incorrect one among the following statements is (    ).‌
选项:
A: MATLAB functions can be called in the C++ program by using MTLAB engine.
B: you can improve the efficiency of application development by using MATLAB engine.
C: You can call the functions written in C++ language directly in MATLAB by using MATLAB engine.
D: The execution efficiency of program that contains the MATLAB engine function is low.
答案: 【 You can call the functions written in C++ language directly in MATLAB by using MATLAB engine.

2、单选题:
‎The header file which define the MATLAB engine function of C++ is (    ).​
选项:
A: mat.h
B: engine.h
C: mex.h
D: matrix.h
答案: 【 engine.h

3、判断题:
‌In MATLAB, the mex command is used to compile the source programs of C++. ‎
选项:
A: 正确
B: 错误
答案: 【 正确

Unit Test 10

1、单选题:
‎After the Spreadsheet Link program is loaded in the Excel system, (    ) will be added in the HOME tab of the Excel window. ​
选项:
A: Excel command group
B: Spreadsheet Link command group 
C: MATLAB command group 
D: Notebook command group
答案: 【 MATLAB command group 

2、单选题:
‍When exporting data from Excel sheets to the MATLAB workspace, an array of (    ) type is generated in the MATLAB workspace. ​
选项:
A: cell
B: double
C: char
D: object
答案: 【 cell

3、单选题:
‎Open a readable and writable file in (    ).‍
选项:
A: r
B: r+
C: a
D: rw
答案: 【 r+

4、单选题:
‏The function to determine whether the file pointer reaches the end of the file is (    ). ‏
选项:
A: ftell
B: fseek
C: feof
D: ferror
答案: 【 feof

5、单选题:
​After executing the following program, the value of C is (    ).‍fid=fopen('data.dat','r+');
fwrite(fid,eye(5));
fseek(fid,0,-1);
B=fread(fid,[5,5]);
C=sum(sum(B))
fclose(fid);
选项:
A: 0
B: 1
C: 25
D: 5
答案: 【 5

6、单选题:
‍In C/C++, the statement used to define a pointer to a MAT file is (    ).  ‌
选项:
A: MATFile *p;
B: MAT *p;
C: File *p;
D: FILE *p;
答案: 【 MATFile *p;

7、单选题:
‎In C/C++, the function used to open the MAT file is (    ).‌
选项:
A: fopen
B: matOpen
C: mexOpen
D: MATFileOpen
答案: 【 matOpen

8、多选题:
‌Which of the following statements are correct about the MATLAB engine. (    ) ‏
选项:
A: MATLAB command can be executed in C/C++ program with MATLAB engine.
B: Through MATLAB engine, the efficiency of developing application program can be improved.
C: Through MATLAB engine, you can directly call C/C++ functions in MATLAB.
D: The execution efficiency of programs containing MATLAB engine functions is reduced.
答案: 【 MATLAB command can be executed in C/C++ program with MATLAB engine.;
Through MATLAB engine, the efficiency of developing application program can be improved.;
The execution efficiency of programs containing MATLAB engine functions is reduced.

9、判断题:
​When the file is not opened successfully with the fopen function, the function returns -1. ​
选项:
A: 正确
B: 错误
答案: 【 正确

10、判断题:
The gateway routine of MEX source program is used to establish connection between MATLAB system and the external routines to be called. ‎
选项:
A: 正确
B: 错误
答案: 【 正确

11、判断题:
MEX source program can be run directly in MATLAB.‌
选项:
A: 正确
B: 错误
答案: 【 错误

12、判断题:
​In MATLAB, you can use mex command to compile C/C++ source program. ​
选项:
A: 正确
B: 错误
答案: 【 正确

Chapter 2 MATLAB Matrix Manipulation

Class Quiz

1、单选题:
‎The main purpose of using sparse storage is to (    ). ‍
选项:
A: change storage order
B: improve operation precision
C: save memory space
D: design efficient algorithm
答案: 【 save memory space

2、单选题:
‌After executing the statement A=sparse([0,1,1;0,0,1]), the last line of the output result is(    ).‎
选项:
A: (1,2)        1
B: (1,3)        1
C: (1,3)        0
D: (2,3)        1
答案: 【 (2,3)        1

3、判断题:
​The matrix which adopts sparse storage method must be a sparse matrix.‏
选项:
A: 正确
B: 错误
答案: 【 错误

4、判断题:
‌The function full(speye(5)) has the same function as the function eye(5).‎
选项:
A: 正确
B: 错误
答案: 【 正确

Unit Test 2

1、单选题:
‍The statement which can create the third order magic matrix is (    ). ‎
选项:
A: M=magic(3)
B: M=MAGIC(3)
C: M=Magic(3)
D: M=magic(1,3)
答案: 【 M=magic(3)

2、单选题:
‏The statement which can create the 5th order matrix A composed of double-digit random integers is (    ). ‌
选项:
A: A= fix(10+89*rand(5))
B: A= fix(20+90*rand(5,5))
C: A= fix(10+90*rand(5))
D: A=fix(10+100*rand(5))
答案: 【 A= fix(10+90*rand(5))

3、单选题:
‏The statement which can create the diagonal matrix P with (x+y)^5 expansion coefficient is (    ). ​
选项:
A: P=diag(flipud(pascal(6)))
B: P=diag(diag(flipud(pascal(6))))
C: P=diag(flipud(pascal(5)))
D: P=diag(diag(flipud(pascal(5))))
答案: 【 P=diag(diag(flipud(pascal(6))))

4、单选题:
‎The expression which can make the diagonal elements of matrix A plus 30 is (    ). ‍
选项:
A: A+30*eye(size(A))
B: A+30*eye(A)
C: A+30*ones(size(A))
D: A+30*eye(4)
答案: 【 A+30*eye(size(A))

5、单选题:
‏After the statement [X,D]=eig(A) is executed, D is a (    ). ‍
选项:
A: triangular matrix
B: diagonal matrix
C: scalar matrix
D: identity matrix
答案: 【 diagonal matrix

6、单选题:
‌The main purpose of using sparse storage is (    ). ‍
选项:
A: change storage order
B: improve operation precision
C: save memory space
D: design efficient algorithm
答案: 【 save memory space

7、单选题:
‎After executing statement A=sparse([0,2,5;2,0,1]), the last line of the output result is (    ). ‌
选项:
A: (2,1)        2
B: (1,2)        2
C: (1,3)        5
D: (2,3)        1
答案: 【 (2,3)        1

8、多选题:
​The statement which can create the third order matrix of ones A are (    ). ‏
选项:
A: A=[ones(3,1), ones(3,1), ones(3,1)]
B: A=ones(3)
C: A=diag(eye(3))*ones(1,3)
D: A=ones(3,3)
答案: 【 A=[ones(3,1), ones(3,1), ones(3,1)];
A=ones(3);
A=diag(eye(3))*ones(1,3);
A=ones(3,3)

9、多选题:
‎Among the following choices, of which two command results are same to each other? (    ).‏
选项:
A: x=(-2:2)' and x=[-2:2]'
B: x=diag(diag(ones(3))) and x=eye(3)
C: x=triu(A,1)+tril(A,-1) and x=A-diag(diag(A))
D: x=rot90(A) and x=fliplr(A)
答案: 【 x=(-2:2)

剩余75%内容付费后可查看

发表评论

电子邮件地址不会被公开。 必填项已用*标注