Matlab basics II Flashcards

1
Q

.mat

A

special data format in matlab; default data file type

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

save

A

saves data from current matlab workspace to file
form: save(‘file_name’, ‘var1’, ‘var2’)
saves 1 or more variables: var1 and var2 in a file with the name file_name
default saves as .mat
can save in more general ascii format:
form: save(‘file_name.dat’, ‘var’, ‘-ascii’)

can also execute save in command form:
save file_name var1 var2
save file_name.dat var1 var2 -ascii

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

load

A

Loads data from a disk file to the current MATLAB workspace:
load(‘file_name’)

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

help

A

built in function; learn more about a specific function

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

doc

A

brings out the help browser window where a more complete help menu about the function will be displayed

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

log(x)

A

natural logarithm of x : lnx

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

log10(x)

A

log base 10 x

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

max(x), min(x)

A

find max, min values in the array x

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

sum(x)

A

vector: sum of elements
matrix: gives a row vector with sum over each column

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

sin(x)`vs sind(x)

A

gives sin of angle in radians vs. degrees

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

sin(x) vs asin(x)

A

sin(x) vs arcsin (x)

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

round(x)

A

rounds x to nearest integer

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

floor(x)

A

rounds x to nearest integer towards negative infinity

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

ceil(x)

A

rounds x to nearest integer towards positive infinity

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

fix(x)

A

rounds x to nearest integer towards 0

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

array operations

A

.* and ./
element-by-element (scalar) operations between two arrays of the SAME DIMENSION
a./b array right division, a/b
a.\b array left division. b/a

17
Q

zeros

A

used to assign value of 0 to a variable or an element/bunch of elements in a variable

18
Q

eye(n)

A

generates identity matrix of dimension (n,n)

ex. eye(3): 3x3 identity matrix

19
Q

syntax error

A

spelling errors, punctuation errors, wrong shape/size/type of input, unbalanced brackets
“Undefined function or variable…”
“arguments dimensions are not consistent”
“expression or statement is incorrect”

20
Q

Runtime error

A

found when function is executing

“exceeds matrix dimensions”

21
Q

Logical/Algorithmic error

A

function executes without error but does not produce the desired result

22
Q

debugging

A

set breakpoints to pause execution of matlab file; step through file

23
Q

subarrays

A

selections of subsets of elements in original array

24
Q

multidimensional array

A

can be created by putting lower dimension arrays together

multid_array(row_no,column_no,page_no,book_no,…)