First Year Flashcards
x = sum (y)
sums the vector y or will sum the values in each column
x = abs (y)
returns the absolute value of y
x = sign (y)
will create a random number
[max, ind] = max (y)
will return the maximum value of and the index. if it is a matrix the max value of each column will appear
For angles which convention is used?
Radians
format for a for loop
for variable = index_values
»code statement referencing index
» end
format for a while loop
> > while (expression)
statements
end
Break function
Jumps out of the loop
Continue Function
goes back to the start of the loop and executes the next iteration without running the remaining code
Return Function
Will return the currently running code
Which function takes precedence in and/or
and takes precedence so bracketing can be used to manually set the order
Indexing formats
CSV is zero
MATLAB is one index
DLM is one index
format for saving a text file
> > save (‘mydata.txt’, ‘-ascii’)
Load command format and use
> > load mydata.mat variable 1
where:
mydata is the filename
variable 1 is what wants to be retrieved
Whats the import wizard used for?
To import a variety of files including images