Matlab Questions Part 2-True / False (13 questions @ 2 points each = 26 points)
ID: 3873552 • Letter: M
Question
Matlab Questions
Part 2-True / False (13 questions @ 2 points each = 26 points) Directions: For each question below, fill in "True" or "False". 13. There are many met hod s of developing an algorithm to solve a computer programming problem. A matrix multiplied by its inverse yields an identity matrix. The first 5 values in: v = [0:05:10] are the numbers 0, 0.5, 1, 1.5, and 2 The MATLAB statement: m zeros(3,4) will assign a 3x4 matrix of zeros to the variable The MATLAB statement: x sqrt(25) will assign a value of 5 (the square root of 25) to the 14. 15 variable "x". 18. The MATLAB statement: y = sum([0 1 2 3 4]) will assign a value of 15 (1+2+3+445) to the variable "y You should be looking at your neighbor's exam right now The "size" of a MATLAB array is the number of columns followed by the number of rows MATLAB variable names must begin with a letter. The MATLAB statement: rpm = input('Enter cadence in rpm:"); prompts a user to input 19 21. 22. cadence and assigns the value to the variable "rpm". on The MATLAB statement: x = [2 3 5 8], uses the transpose operator to assign a 4x1 column vector to the variable "x". 24 The MATLAB statement: matrix 1eye(3) will assign a 5x5 identity matrix to the variable "matrix 1'" _ The following MATLAB syntax will create a two-dimensional plot of a sine wave across x x = 0:100; y = cos(x); plot(x,y); values from 0 to 100:Explanation / Answer
13) True , Yes there are many methods for developing an algorithm to solve a computer pogramming
14) True , AA-1 = I where I is Identoity matrix
15) True , It starts with 0 i ncrements by 0.5 till 10..Values are 0,0.5,1,1.5,2,2.5 etc
16) True, It wil create a matrix of zeros of 3 rows and 4 colums. Total 12 elements with 0s
17) True, sqrt is Square root function in matalab that gives us SQRT
18) True, it will sum to 15
19) No, doing it myself
20) False, Size gives us number of rows and then the number of columns
21) False, we cannot have variable name begining with number , it can begin with underscore as well and not always letter
22) true
23) A = [2 3 5 8]
x= transpose(A)
24) False , eye(3) will create 3x3 matrix and not 5x5
25) False, it will create cos waves and not sine wave
Thanks, let me know if there is any doubts