Math Computations
Variables
Vectors and Matrices
100
What is the command for 3 times 5 in MATLAB?
3*5
100

How to define a variable (string or integer) in MATLAB? 

name = "Terry";

number = 2;

100

What is the result in MATLAB? 

(35 + 25) / 5 

12

200

What is the command for the sum of A = [1 2 3] and B =[2 3 4] and display the sum of the two arrays? 

A=[1 2 3];

B =[2 3 4];

disp (A+B)


200

For the following MATLAB commands, what will X be? Are x and X the same variables?

 x=10 

X=x^2

X=100

no

200

What is the result in MATLAB ?

8 + 3 * 5

23

300

What is the command to divide each element of [12 18 24] by the corresponding element of [3 6 8] and display the solution? 

A = [12 18 24];

 B = [3 6 8]; 

disp(A ./ B)

300

What will the semi-colon do in the following MATLAB command? What is the result of x =10;?

To suppress the result and the result will not be shown in the command window.

300

What is the result in MATLAB? 

(18 - 6) / (2 + 1) * 4

16

400

What is the command to subtract and display A= [2 4 6] from B=[10 10 10]?

A = [10 10 10]; 

B = [2 4 6]; 

disp(A - B)

400

What is the command to create [5 10 15 20 25], change the third value to 30, and display the array.

A = [5 10 15 20 25]; 

A(3) = 30;

 disp(A)

400

What is the result in MATLAB? 

(7 + 5)^2 / 9

16

500

What is the command to multiply and display the product of corresponding elements of A= [2 3 4] and B= [5 6 7]? 

A = [2 3 4]; 

B = [5 6 7]; 

disp(A .* B) 

500

What is the command to create [2 4 6 8 10], add 3 to every element, and display the result?

A = [2 4 6 8 10]; 

disp(A + 3)

500

What is the result in MATLAB? 

(3^4 - 1) / 8

10