Matlab basics II Flashcards
.mat
special data format in matlab; default data file type
save
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
load
Loads data from a disk file to the current MATLAB workspace:
load(‘file_name’)
help
built in function; learn more about a specific function
doc
brings out the help browser window where a more complete help menu about the function will be displayed
log(x)
natural logarithm of x : lnx
log10(x)
log base 10 x
max(x), min(x)
find max, min values in the array x
sum(x)
vector: sum of elements
matrix: gives a row vector with sum over each column
sin(x)`vs sind(x)
gives sin of angle in radians vs. degrees
sin(x) vs asin(x)
sin(x) vs arcsin (x)
round(x)
rounds x to nearest integer
floor(x)
rounds x to nearest integer towards negative infinity
ceil(x)
rounds x to nearest integer towards positive infinity
fix(x)
rounds x to nearest integer towards 0