Logo

Matlab Questions Set 39:

Quiz Mode

  A for-loop can have multiple index values. 

1
2

Solution:

What is the output of the following MATLAB code?

k=uint8(16);

k = 20;

class(k)

1
2
3
4

Solution:

  How will we integrate a non-linear function, f, taken as an inline function 

1
2
3
4

Solution:

 To display the runs scored by a batsman towards different directions in a field uses____

1
2
3
4

Solution:

Given the following matrices:

A = [1 1 0 0]
B = [1 2 3 4]

What is the result of the matrix multiplication C = A * B?

1
2
3
4

Solution:

 How does MATLAB get the symbolic character in the function, if it is not mentioned in symsum() command 

1
2
3
4

Solution:

What is the output of the following code?

b1 = [0 1 0 1 1];

b2 = [1 1 1 0];

d1 = bi2de(b1, 'left-msb')

d2 = bi2de(b2, 'left-msb')

disp(d1);

disp(d2);

1
2
3
4

Solution:

  How do you create a function file in MATLAB 

1
2
3
4

Solution:

  How do we access a global variable in nested functions 

1
2
3
4

Solution:

What is the output of the following code?

function res = calc(M)

[r c] = size(M);

res = 0;

for i = 1:r

    for j = 1:c

        res = res + M(i,j);

   end

end

end

Given: M = [1 2 3; 4 5 6; 7 8 9]

1
2
3
4

Solution: