Built-in Functions Flashcards

(39 cards)

0
Q

help [insert word here]

A

Explains word.

Ex. Help, format, elfun, etc.

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

Demo

A

Shows MATLAB examples in help window

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

doc

A

Shows documentation page in help window

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

Quit

Exit

A

Close MATLAB

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

namelengthmax

A

63

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

who

A

Shows variables in command window

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

whos

A

Shows variables and information in command window

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

clear

A

Deletes variables

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

intmin (‘int8’)

intmax (‘int8’)

A

-128

127

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

intmin (‘int16’)

intmax (‘int16’)

A

Help!

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

intmin (‘int32’)

intmax (‘int32’)

A

Help!

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

format short

A

Answer in four decimal places

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

format long

A

Answer in 15 decimal places

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

Format loose

A

Double spaced

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

Format compact

A

Single spaced

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

fix (x)

A

Rounds towards zero

16
Q

floor (x)

A

Rounds towards negative infinity

17
Q

ceil

A

Rounds toward positive infinity

18
Q

rem (x, y)

A

Returns remainder of x/y

19
Q

mod (x, y)

A

Returns remainder of x/y. Mod (x, 0) returns x.

20
Q

Sign (x)

A

Returns 1 or -1 depending on sign of x.

21
Q

nthroot (x, y)

A

Returns the y- root of x.

22
Q

exp (n)

23
Q

rand

A

Returns random number between 0 and 1

24
rng ('shuffle')
Sets seed to clock time
25
rng ('intseed')
Sets seed to an integer
26
rng ('default')
Sets seed to default number determined by MATLAB startup.
27
rand*10
Random number between 0 and 10
28
rand *(high - low) + low
Generates a random number between high and low.
29
round (rand)
Rounds the random real number produced by rand to an integer.
30
randi ([intmin, intmax])
Generates random integer between intmin and intmax.
31
length (vec)
Returns number of elements in vector.
32
length (mat)
Returns number of rows or columns, whichever is larger
33
size (vec) | size (mat)
Returns the number of rows and columns Hint: [r c] = size (mat)
34
numel (vec) | numel (mat)
Returns number of elements.
35
fliplr (mat) flipud (mat) rot90 (mat) reshape (mat)
Ways to alter a matrix
36
vec = [ ]
Creates an empty vector
37
vec (x) = [ ]
Deletes the x-th element Note: individual elements cannot be removed from matrices. Must remove an entire roe or column. mat ( : , x) = [ ]
38
diff(vec)
Returns the difference between elements in vec. Length will be 1 less than length of vec.