MATLAB EXTRA 1

0.0(0)
studied byStudied by 4 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/64

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

65 Terms

1
New cards

What will be the output of the code all

([1 0 1 0])?

0

2
New cards

What is the output of the code 2 * 0 ^ 0 + 9?

11

3
New cards

What will be the output of the code Inf (74 & sin(nan))?

error

4
New cards

What will be the output of the code all([NaN])?

error

5
New cards

What will be the output of the code xor(3476, 1234)?

1

6
New cards

What will be the output of the code any(sin(0), NaN)?

1

7
New cards

What will be the output of the code all(sin([pi]))?

1

8
New cards

The correct hierarchy of operation is:

>>=&1

9
New cards

Predominantly, what are the two kinds of errors in MATLAB programs?

syntax and runtime

10
New cards

Which code would you use to find the value of the function f(x) = sin(x) + cos(x) + tan(x) at x = 1?

sin(45) + cos(d45) + tand(45)

11
New cards

What command in MATLAB is used to create new variable?

var

12
New cards

The num2str command means

converts a number to string

13
New cards

To display ‘Question 2’ in command window, the correct command is

disp (‘Question 2’)

14
New cards

To add comment to the mfile, the MATLAB command

%

15
New cards

What is the name of a primary function?

Name of M.file

16
New cards

What are persistent variables?

variables which retain values between calls to the function

17
New cards

Which command can be used for single step execution in debugging mode?

dbstep

18
New cards

How do we access a global variable in nested functions?

declare the variable as global

19
New cards

How does MATLAB help in passing function arguments?

by call by value and call by reference

20
New cards

What is the default variable while evaluating transfer function?

s

21
New cards

What is the default variable while evaluating Laplace transform?

s.

22
New cards

The output of the following code is
laplace(exp(-3*p))

error due to p

23
New cards

The output of the following code is
solve('w+z=0')

-z

24
New cards

The default variable in case of solve (‘f(x,y,p,a,l)’ ) command is

x

25
New cards

What is the default parameter for dsolve() command

input differentiating variable

26
New cards

What is the default parameter for the ‘ztrans()’ command

z

27
New cards

What is the output of the following code? syms x; laplace(exp(-3x),x,y)

error

28
New cards

Matlab allows modeling of different control systems using

simulink

29
New cards

How to stop the execution of a chain of commands

press ctrl + c

30
New cards

What are MEX files in MATLAB?

Allows the user to combine C source files with MATLAB

31
New cards

How would you plot multiple graphs in MATLAB?

using the held function

32
New cards

How do you show the program of a MAT file

the program cannot be shown while running a MEX file

33
New cards

What is the equipment of subplot (1,1,1)?

axes

34
New cards

The command used to reflect film from disk into the workspace is

load

35
New cards

The format for 5 digit representation along with exponent is

short -e

36
New cards

Which operator in c used to prevent the printing of insignificant terms?

%g

37
New cards

The function to plot a graph with both axes logarithmic scale is

loglog

38
New cards

We can plot a discrete and continuous relationship in the same graph

false

39
New cards

it not possible to store graph as MAT file

40
New cards

How do we break from an infinite loop without keeping a break statement within the loop?

press Ctrl + C

41
New cards

The nature of complex input taken by the sparse() command is

sparse

42
New cards

What is the attribute of sparse matrix?

imaginary & real part

43
New cards

which of the following can be the space taken up by sparse matrix

25 MB

44
New cards

A sparse identity matrix is generated by which command?

speye

45
New cards

Which command is used to generate a sparse normally generated matrix?

sprandn

46
New cards

What is the output of the following code?

47
New cards

The non-zero elements in sparse matrix are shown by which command?

48
New cards

What is the output of the following code?
A = [0 Inf Inf 0 0; 2 9 7 0; sin (Inf) 8 0 0];
P = sparse (A); nnz (P)

Imemory > amemory

49
New cards

The size of the sparse matrix will be ____ the original matrix.

equal

50
New cards

The maximum space allocated for sparse matrix is given by which command?

nzmax

51
New cards

Which matrix has most of the elements (not all) as zero.

sparse matrix

52
New cards

What is the relation between Sparsity and Density of a matrix?

Sparsity = 1 - Density

53
New cards

Who coined the term Sparse Matrix?

Harry Markowitz

54
New cards

The matrix contains in rows and n columns. The matrix is called Sparse matrix if

Total No. of Zero elements > (m*n)/z

55
New cards

Which of the following is not the method to represent Sparse matrix?

heap

56
New cards

Is Sparse matrix also known as Dense matrix?

false

57
New cards

Which one of the following is a Special Sparse matrix?

band matrix

58
New cards

in what way the Symmetry Sparse matrix can be stored efficiently?

binary tree

59
New cards

The output of the following command is


a = [123; 400; 309]; spy(A)

60
New cards

Executing in the command window the following code returns
a = [1:3]; size(a)

3 1

61
New cards

Command used to save command window text to file

diary

62
New cards

Executing in the editor window the following code returns
a = 1; sin(a)

0.8415

63
New cards

Which is invalid variable name in MATLAB?

6x

64
New cards

Command used to display the value of variable x

disp(x)

65
New cards

What command is used to clear a command window

clc