Font size
WorksheetsMATLAB variables. Types. Declaration. Operations.
Total questions: 10
Worksheet time: 3mins
Select all variable types that exist in MATLAB.
int10
single
logical
array
script
What command will create the row vector a = ( 4 15 23 81 ) ?
a = [4 15 23 81]
a = [ 4, 15, 23, 81]
a = [ 4; 15; 23; 81]
a = [ 4,15 23, 81]
What will be the last element of vec variable if the last one was generated using following MATLAB command:
>> vec = 1:3:110;
?
MATLAB will display an compilation error
112
110
109
How many elements will have the array term generated by the MATLAB command:
>> linspace ( 3 , 3.1 );
?
100
1
2
15
What MATLAB commands will generate a similar result?
a = ones
a = zeros
a = eye
a = eye(3)
Select the MATLAB command that will generate equivalent results.
b = [3, 2, 1]'
b = [3; 2; 1]
b = zeros(3, 2, 1)
b = pascal (3, 2, 1)
A matrix was declared as in the left-side image. Which command assigns to scalar s value 10?
s = matrice(3,2)
s = matrice(end,end)
s = matrice(2,3)
s = matrice(1,3)
A matrix was declared as in the left-side image.
Select the right values for x components, if x was generated by the following MATLAB command
>> x = size(test);
x (1) = 3
x (2) = 7
x (1) = 5
x (2) = 15
x (1) = 7
x (2) = 3
x (1) = 15
x (2) = 5
Suppose that matrix A and vector b are saved in MATLAB Workspace with the values represented in the left-side picture. Which result will be displayed by the following command rezultat = A*b; ?
For two matrices A and B defined as in the left-side picture, what will be the result of command A./B?
