MATLAB Flashcards

Study for Quiz (52 cards)

1
Q

MATLAB is a program for doing what?

A

Numerical Computation

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

What type of problems was MATLAB originally designed to solve

A

Linear algebra-type problems using matrices

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

Is MATLAB a high-level language or slow-level language

A

MATLAB is a high-level language

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

Where was the MATLAB name derived from

A

MATrix LABoratory

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

True OR False:
MATLAB is an interpreted language

A

TRUE

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

The MATLAB language is a _____________ language

A

A high-level matrix/array language

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

Results of computations made in the command window are saved in variables in the _________

A

The Workspace

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

The semicolon(;) is used to ___ and _____ the MATLAB output for an expression ( when placed at the end of a statement)

A

suppress and hide

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

What operator is used to denote a comment?

A

%

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

what does … do?

A

It continues the statement on the next line

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

True or False:
Variables must begin with a letter

A

TRUE

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

True or False:
In MATLAB, some variables are arrays and or matrix.

A

FALSE!!!
In MATLAB, EVERY variable is an array or matrix.

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

True or False:
variables are NOT case-sensitive

A

FALSE!!!
Variables ARE case-sensitive

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

True or False:
Variables can be a mix of letters, digits, and underscores

A

TRUE

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

True or False:
Variables can be more than 63 characters long and can be generic

A

FALSE Variables can be UP TO 63 characters long and MUST be unique

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

True or False:
Variables may contain blank spaces or other types of punctuation like reserved characters

A

FALSE!!
Variables may not contain blank spaces or other types of punctuation such as reserved characters: % = + = ~ ; : ! ‘ [] () , @ # $ & ^

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

True or False:
When a semi-colon (;) is placed at the end of each command, the result is displayed

A

FALSE
When a semi-colon (;) is placed at the end of each command, the result is NOT displayed

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

True or False:
Less than sign (<)

A

TRUE

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

True or False:
Less Than or Equal sign (=<)

A

FALSE!!!
The proper sign is (<=)

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

True or False:
Greater Than sign (>)

A

TRUE

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

True or False:
Greater Than or Equal (>=)

22
Q

True or False:
Equal to (=)

A

FALSE the equal to sign is (==)
whereas the (=) is an assignment

23
Q

True or False:
Not Equal to !=

A

FALSE!!
In MATLAB the not equal to sign is (~=)

24
Q

What is the default display format

A

short ( four digits after the decimal point)

25
format long
16 digits
26
format short e
5 digits plus exponent
27
format long e
16 digits plus exponent
28
format hex
hexadecimal
29
format bank
two decimal digits
30
format +
positive, negative or zero
31
format rat
rational number (215/6)
32
format short
default display
33
The who command displays what?
All the variable names that has been used
34
What does the ans mean?
ans is the deault variable name for results/ the most recent answer
35
What does the eps mean?
The smallest incremental number/ accuracy of floating-point precision
36
MATLAB allows for what two types of arithmetic operations?
Matrix arithmetic operations and Array arithmetic operations
37
TRUE OR FALSE: MATLAB the /-right division and the \-left division produces the same result
FALSE!!!! They DO NOT produce the same results
38
A Vectors is a_________
one-dimensional array of numbers
39
TRUE OR FALSE: MATLAB allows creating two types of vectors
TRUE 1. Row vectors 2. Column Vectors
40
TRUE OR FALSE: To add or subtract two vectors the operand vectors can be different type and have different number of elements.
FALSE: BOTH of the operand vectors MUST be of SAME TYPE and have SAME number of elements.
41
What does the transpose (') operation do?
It changes a column vector into a row vector and versa
42
What are the four control flow commands in MATLAB
the for loop, while loop, if-else-end, switch-case
43
Syntax of the for loop
for index = vector statements end
44
Syntax of the while loop
while logical expression statement end
45
When is the while loop used
The loop is used when the programmer does not know the number of repetitions a priori.
46
TRUE OR FALSE: The WHILE loop will continue to repeat a section of code until its conditional statement is true (returns 1)
FALSE!! The WHILE loop will continue to repeat a section of code until its conditional statement is FALSE (returns 0)
47
Syntax of the if statement
if expression commands end
48
Syntax of the if-else
if expression command ( evaluated if expression is else) else command ( evaluated if expression is false) end
49
True or False: The convention for naming functions is the same as for variables
TRUE
50
How do you define a vector?
Define a vector with the (:) operator (begin: interval: end) ex: x = 1:2:9
51
Relational operators for arrays perform ______________ comparisons between two arrays and return a logical array of the same size, with elements set to logical 1(true), and elements set to logical 0 (false)
element-by-element
52
scalar multiplication of vectors
Scalar multiplication produces a new vector of same type with each element of the original vector multiplied by the number