My Report

MATLAB Practice Test 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What does the Workspace show?

2. The uniform distribution can range from -infinity to 0 or 0 to Infinity but not from -infinity to infinity.

3. What is the conclusion from the following code?

 >>whos
 Name     Size         Bytes    Class     Attributes
 ans      1x1            8      double              
 ap       1x1          112  	sym              
 c        1x2            4      char
 p        1x1            8      double

4. Round each value in a duration array to the nearest number of seconds greater than or equal to that value.

t = hours(8) + minutes(29:31) + seconds(1.23);
t.Format = 'hh:mm:ss.SS'
t = 08:29:01.23   08:30:01.23   08:31:01.23
Y1 = ceil(t)
Y2 = ceil(t,'hours')

5. What will be the output for the below block of code?

	P=[1 3 2]; r=roots(P);	

6. Find the error in the following code?

Predicted output: (b + (b2 - 4*a*c)(1/2))/(2*a)
     (b - (b2 - 4*a*c)(1/2))/(2*a)
Code: solve (b*x2 + c*x + a == 0)
Present output: -(c + (c2 - 4*a*b)(1/2))/(2*b)
 		-(c - (c2 - 4*a*b)(1/2))/(2*b)

7. What would be the output of the following code (in editor window)?

X = [1 2 3;4 5 6;7 8 9];
Y = [9 8 7;6 5 4;3 2 1];
R = rem(X,Y)

8. What would be the output of the following code (in editor window)?

A = [1 0 2]	;	b = [3 0 7]	;	c=a.*b;

9. Conversion Function int16 uses_________ range of value?

10. Compute 24 modulo 5.

b = mod(24,5)

 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.