Question: MATLAB 1. (3 marks) Write a MATLAB command that calculates and outputs the result of the following expression: 7532914+(311)463 2. (3 marks) Write the MATLAB
MATLAB


1. (3 marks) Write a MATLAB command that calculates and outputs the result of the following expression: 7532914+(311)463 2. (3 marks) Write the MATLAB commands that assign 5.3 and 7.6 to variables m and n, respectively, and then computes and outputs the result of the following expression: m32+nm+2(m+n)em 3. (3 marks) The surface area (SA) of a cylinder is given by SA=2rh+2r2 where r is the radius and h is the height. Write the MATLAB commands to compute the surface area of a cylinder with radius = 6.7 and height =8.9. You should first define and assign the variables r and h, and then compute and output the surface area using the variable SA. 4. (3 marks) Write a MATLAB command that creates a row vector V with the elements sin(7)2log10(222)ecos(13) where cos(x) is the absolute value of the cosine of x. Then, write the command to find the maximum of V. 5. (3 marks) Write the MATLAB commands that assign 3 and 4 to the variables foo and boo, respectively. Then, create a column vector W with the elements foo3boo!fooln(fooboo)3boofoo(foo+boo)2(boo)2 where y! is the factorial of y, for which you should use a built-in MATLAB function, and ln(x) is the natural logarithm of x. Finally, compute and output the average of the elements in W. 6. (5 marks) Write the MATLAB commands that create and output the following matrix by using shorthand methods for creating vectors with constant spacing. Do not type individual elements explicitly. B=10701.1020651.2130601.3240551.43 Then, do the following: - Create and output a variable f by assigning the value in the 3rd row and 4th column of B to f. Do not type the value explicitly. - Create and output a row vector C by assigning the 3rd row of B to C. Do not type the values explicitly. - Create and output a 22 matrix named M that is assigned the elements in the middle of B. Do not type the values explicitly. 7. (5 marks) Write the MATLAB commands that create the following matrices using a minimum number of zeros, ones, and eye functions. Do not type the values explicitly. F=1100101010011111G=01110100001000010111 Then, compute and output in a single command the total number of ones in F and G. 8. (5 marks) Write the MATLAB command using shorthand notation to create the following vector S : S=[112233445566778899] Then, create a 33 matrix T from the values in S as follows: T=114477225588336699
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
