Class Notes Flashcards
1
Q
how do you create an array?
A
x = [start:step size:end]
2
Q
what is the command for determining the size of an array
A
size(x)
3
Q
what is the command for determining the length of an array
A
length(x)
4
Q
how do you find the minimum and maximum value of an array?
A
min(x)
max(x)
5
Q
what are the rules for a function?
A
- function name must match the file name
- all files must be in the same directory
- function statement but be first
- # of inputs and outputs must match
- put “end” at the end of the function
6
Q
what are the programming constraints?
A
- sequential
- decision making (conditional)
- iterative (loop)
7
Q
what is a proper programming style?
A
header info
data input (put in main program, not the function)
process data
display