Class Notes Flashcards

1
Q

how do you create an array?

A

x = [start:step size:end]

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

what is the command for determining the size of an array

A

size(x)

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

what is the command for determining the length of an array

A

length(x)

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

how do you find the minimum and maximum value of an array?

A

min(x)

max(x)

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

what are the rules for a function?

A
  1. function name must match the file name
  2. all files must be in the same directory
  3. function statement but be first
  4. # of inputs and outputs must match
  5. put “end” at the end of the function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are the programming constraints?

A
  1. sequential
  2. decision making (conditional)
  3. iterative (loop)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is a proper programming style?

A

header info
data input (put in main program, not the function)
process data
display

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