Built-in Functions Flashcards

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)

A

Returns e^n

23
Q

rand

A

Returns random number between 0 and 1

24
Q

rng (‘shuffle’)

A

Sets seed to clock time

25
Q

rng (‘intseed’)

A

Sets seed to an integer

26
Q

rng (‘default’)

A

Sets seed to default number determined by MATLAB startup.

27
Q

rand*10

A

Random number between 0 and 10

28
Q

rand *(high - low) + low

A

Generates a random number between high and low.

29
Q

round (rand)

A

Rounds the random real number produced by rand to an integer.

30
Q

randi ([intmin, intmax])

A

Generates random integer between intmin and intmax.

31
Q

length (vec)

A

Returns number of elements in vector.

32
Q

length (mat)

A

Returns number of rows or columns, whichever is larger

33
Q

size (vec)

size (mat)

A

Returns the number of rows and columns

Hint:
[r c] = size (mat)

34
Q

numel (vec)

numel (mat)

A

Returns number of elements.

35
Q

fliplr (mat)
flipud (mat)
rot90 (mat)
reshape (mat)

A

Ways to alter a matrix

36
Q

vec = [ ]

A

Creates an empty vector

37
Q

vec (x) = [ ]

A

Deletes the x-th element

Note: individual elements cannot be removed from matrices. Must remove an entire roe or column.
mat ( : , x) = [ ]

38
Q

diff(vec)

A

Returns the difference between elements in vec. Length will be 1 less than length of vec.