chapter 4 Flashcards

(61 cards)

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
tab completion
user can enter first few letters of a function and press tab so see what Matlab functions are available
26
function documentation
how to use certain Matlab functions
27
help functionName
summary of how to use function
28
doc functionName
detailed summery
29
help elfun
list of elementary math function
30
help specfun
list of special functions
31
what happens if you clear a predefined function?
nothing, it has the Matlab programmed function
32
input
function that obtains number from user
33
prompt
string that prompts user to input data
34
live editor graphic controls
slider, check box, drop down, edit field, button
35
disp
output value of a variable is displayed in a certain way
36
fprintf
function prints formatted output from program
37
38
format operations
controls notation, alignment, sigfigs, etc in format specification
39
%f
prints floating point number as text with point notations
40
%d
decimal integer
41
%i
integer
42
%c
character
43
%s
string
44
special character
2 character sequence used to print special items in format specification
45
/n
new line
46
"
print single quote
47
%%
print one percent character
48
\\
print one backslash
49
tt
prints tab
50
fprintf("%d", width);
print width as a decimal integer in single quotes
51
conversion character
changes format of floating point number
52
%e
scientific notation w/ lower case e
53
%g
either %f or %e, whichever is shorter
54
%E
scientific notation with capital E
55
%G
either %f or %E whichever is shorter
56
conversion specification
specifies how floating point number should be printed out, like alignment, spaces, and number of digits after decimal
57
-
just left display
58
fieldWidth
minimum number of digits displayed
59
precision
number of digits to right of decimal
60
conversion specification format
%-fieldWidth.percision convChar
61