chapter 4 Flashcards

1
Q

script

A

sequence of statements stored in a file
simple form of program
executed line by line top to bottom

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

live script editor

A

used to create .mlx script
1) define and italicize variables
2) run script from command window
3) script reads and modifies variables in base workspace
4) variables can be modes from command line or within the script

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

whos

A

shows all variables and more Information about them (size, bytes)

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

comment

A

text added for explanation of program

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

%

A

single line comment, interpreter ignores the text right of % on that line

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

block comment

A

when multiple lines needed, start with
%{ and end with %}
operators should be on their own lines

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

whitespace

A

blank lines that make code easier to read, good practice for style

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

help comments

A

comment before beginning of script file that explains what’s happening

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

custom function

A

list of statements programmer creates and gives specific name

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

inputs

A

variables or values you put into function

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

outputs

A

variables or values that you calculate with functionfn

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

function call

A

reference to functions name

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

passing

A

providing input values during function calla

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

arguments

A

values

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

local variable

A

variable created inside function that doesn’t exist outside of it

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

function call to assign values

A

values assigned are called arguments and can be multiple w/ commas or arrays

function( argument)

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

local function

A

functions stored at end of script

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

advantage of local function

A

share script between users is simplified

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

disadvantage of local functions

A

local function in one script can’t be accessed by other scripts, can’t be called from command

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

function workspace

A

temporary area where functions perform all calculations

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

callstack

A

another word for function workspace

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

predefined trig functions

A

sin, sind (sin in degrees), asin (inverse sin) etc

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

predefined hyperbolic functions

A

sinh (hyperbolic sin) asinh (inverse hyperbolic sin)

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

predefined exponential functions

A

exp (exponent), log, sqrt, etc

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

tab completion

A

user can enter first few letters of a function and press tab so see what Matlab functions are available

26
Q

function documentation

A

how to use certain Matlab functions

27
Q

help functionName

A

summary of how to use function

28
Q

doc functionName

A

detailed summery

29
Q

help elfun

A

list of elementary math function

30
Q

help specfun

A

list of special functions

31
Q

what happens if you clear a predefined function?

A

nothing, it has the Matlab programmed function

32
Q

input

A

function that obtains number from user

33
Q

prompt

A

string that prompts user to input data

34
Q

live editor graphic controls

A

slider, check box, drop down, edit field, button

35
Q

disp

A

output value of a variable is displayed in a certain way

36
Q

fprintf

A

function prints formatted output from program

37
Q
A
38
Q

format operations

A

controls notation, alignment, sigfigs, etc in format specification

39
Q

%f

A

prints floating point number as text with point notations

40
Q

%d

A

decimal integer

41
Q

%i

A

integer

42
Q

%c

A

character

43
Q

%s

A

string

44
Q

special character

A

2 character sequence used to print special items in format specification

45
Q

/n

A

new line

46
Q

A

print single quote

47
Q

%%

A

print one percent character

48
Q

\

A

print one backslash

49
Q

tt

A

prints tab

50
Q

fprintf(“%d”, width);

A

print width as a decimal integer in single quotes

51
Q

conversion character

A

changes format of floating point number

52
Q

%e

A

scientific notation w/ lower case e

53
Q

%g

A

either %f or %e, whichever is shorter

54
Q

%E

A

scientific notation with capital E

55
Q

%G

A

either %f or %E whichever is shorter

56
Q

conversion specification

A

specifies how floating point number should be printed out, like alignment, spaces, and number of digits after decimal

57
Q

-

A

just left display

58
Q

fieldWidth

A

minimum number of digits displayed

59
Q

precision

A

number of digits to right of decimal

60
Q

conversion specification format

A

%-fieldWidth.percision convChar

61
Q
A