MATLAB Flashcards

1
Q

What does Matlab stand for?

A

Matrix Laboratory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What symbol precedes all comments in Matlab?

A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which of the following is not a pre-defined variable in Matlab

A

Gravity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

This Matlab command clears all data and variables stored in memory

A

Clear

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Characters in Matlab are represented in their value in memory

A

ASCII

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is not an aspect of a for/while loop

A

Runner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

To better manage memory and prevent unnecessary memory allocations, Matlab uses:

A

Delayed copy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

To print a newline in a fprintf statement, you must use the following escape character l

A

\n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In Matlab, this keyword immediately moves to the next iteration of the loop

A

continue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which of the following will correctly define x,y, and z as symbols?

A

syms x y z/ syms xyz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the these is the way to access the first element in a vector named v (assuming there is at least one element in the vector)?

A

v(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following is used to see of two elements are equal in MATLAB?

A

=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If vector = [1 2 3 4; 11 24 92 100; 345 65 90 1]. What will the value of a be equal to if this code is entered into Matlab&raquo_space; [ a b ] = size (vector)?

A

1 2 3 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the value of ans that is printed when the following code is run: isnumeric(32)

A

1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If I want to save a formatted string to memory, but don’t want to print it out, which command should I use?

A

sprintf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When used in the fprintf, the %g is used as

A

Default number display

17
Q

When used in the fprintf command, the \n is used to

A

Add a line space (enter key)

18
Q

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

A

disp(‘Question 2’)

19
Q

The clc command is used to

A

Clear the command window

20
Q

The num2str command

A

Converts a number to string

21
Q

“The output of the last line is
aa=2
as=num2str(a2.
cat=[‘cat’ as]

A

cat1

22
Q

To join one or more strings into a single string is known as

A

Concatenation

23
Q

The output of cat=[‘cat’ ‘dog’] is

A

catdog

24
Q

Which functions help you to save and load variables?
Expl. There is a pre-defined function in MATLAB to store the variable values from your workspace permanently called “save filename”

A

> > save Lays a b
load (‘myfile.mat’)

25
Q

To display comments of M-file, we use ______

A

echo on

26
Q

Where do we need to store a function to call it in other programs?

A

The bin folder

27
Q

What are the difference between the ‘help’ and the ‘look for’ command?
Expl.
Help = command is used to return all the commands surrounding a particular toolbox name entered along with it.
Look for = command is used to return a particular function or set function or set of functions whose name matches with the keyword entered

A

Help returns the entire set while look for returns specific commands

28
Q

“What will the following set of commands do when they are present in a script file?
stem[y1, y2];
title(‘p’)
print -deps l

A

Store the graph as a separate file

29
Q

The function to close the windows containing graphs generated from MATLAB is

A

Close all

30
Q

What is not displayed by the workspace?

A

Time of variable generation

31
Q

MATLAB allows modelling of different control systems using ______

A

Simulink

32
Q

How to stop the execution of a chain of commands?

A

Press ctrl + c

33
Q

What are MEX files in MATLAB?

A

Allows the user to combine C source files with MATLAB files

34
Q

Explain what is MATLAB? Where MATLAB may be applicable?

A

MATLAB is a high-level programming language with an interactive surroundings for visualization, numerical computation and programming characteristic.

35
Q

What does MATLAB consist of?

A

MATLAB includes five fundamental parts

Matlab language
Matlab running environment
Handle graphics
Matlab function library
Matlab application program interface (API)

36
Q

To add a comment to the mfile, the Matlab command is

A

%