Final Review Flashcards

(80 cards)

1
Q

Functions

A
special M-files that have their own workspace, do not have access to the variables in the Command window workspace and cannot change those variables. Receive data through input argument list, return results through output argument list
function [list of output arguments] = function_name[list of input arguments]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

dummy arguments

A

the input and output arguments specified in a function

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

actual arguments

A

when a function is called/invoked in a script or in another function

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

local variables

A

available only in the function where they are defined

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

global variables

A

shared between all workspaces using “global memory” , any function can change the values of a global variable.

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

nargin(‘function_name’)

A

returns number of input arguments of a function

-1 if various numbers of arguments are allowed

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

nargout(‘function_name’)

A

returns number of output arguments of a function

-1 if various numbers of arguments are allowed

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

fminbnd

A

minimizes a function of one variable

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

fzero

A

finds a zero of a function of one variable

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

quad

A

numerically integrates a function

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

fplot

A

plots a function in given limits on x- and y- axis

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

ezplot

A

“easy” function plotter using default limits

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

strings

A

1-D arrays of chars, also created by single quotation marks: ‘string’

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

character constants

A

have type char and are created by enclosing characters in single quotation marks ‘a’

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

ischar(variable)

A

tests for presence of a scalar char or an array of chars, returns 1 if true and 0 if not

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

char()

A

converts type to character

if an array, automatically pads entries with whitespaces to make same number of columns

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

double()

A

converts type to double; double value of a character is the numerical code used in MATLAB to represent that character

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

character arrays

A

arrays with character entries
each row of a 2-D character array must have the same number of columns or it will produce a MATLAB error
can pad with whitespaces to make it fit

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

deblank()

A

emoves all of the whitespace characters from the end of a string
NOTE: whitespace characters correspond to ASCII codes for spaces: SP , horizontal tabs: (HT), linefeeds (LF), vertical tabs (VT) form feed (FF) and carriage return (CR)

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

strtrim()

A

removes all leading AND trailing whitespace characters from a string

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

strcat()

A

concatenates/joins two or more strings and deletes any trailing whitespace
ex: strcat( ‘string1 ‘, ‘string2 ‘) = string1string2

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

strvcat()

A

joins two or more strings together vertically and automatically adds padding

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

relational operators for char

A

when relational operators are used for characters, they compare the values of the corresponding ASCII codes

can also be used to compare strings, but strings MUST HAVE EQUAL DIMENSIONS. returns a one in any position where the strings have the same character and a zero in positions where the strings differ

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

strcmp()

A

determines whether or not two strings are 1. equal in length and 2. contain the same characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
strcmpi()
determines whether or not two strings are 1. equal in length and 2. contain the same characters but ignores upper vs lowercase
26
strncmp()
determines whether two strings contain the same n leading characters
27
strncmpi()
determines whether two strings contain the same n leading characters, ignores upper vs lowercase
28
findstr('string', 'substring')
finds the starting position of ALL occurrences of a substring within an identified string
29
strmatch()
finds the rows in an array that match the given substring, returns them like: result = strmatch(‘substring’, string_variable) result = 1 2
30
strrep(string_variable, ’substring_to_be_replaced’,’new_substring’)
finds and replaces all occurrences of the first listed substring with the second one
31
upper()
modifies a string by converting all lower case letters to upper case
32
lower()
modifies a string by converting all upper case letters to lower case
33
int2str()
converts a numerical value of type double into the corresponding string (type char)
34
num2str()
converts a numerical value (of any type) into the corresponding string optional second parameter controls the format (length of the string. Note: the value might appear rounded but the effective value is still the unrounded number)
35
sprintf
similar to formatted output function fprintf but the output is sent to a string instead of the Command Window: useful for titles of plots and labels
36
cell array
a data structure that stores values of different types; one name for the data structure and each element is identified by it’s number(location in the cell array) Created like normal arrays but curly brackets are used instead of square ones Can create an empty cell array and assign values to specific element Accessing elements is same as in normal array, but curly brackets are used Contents can be viewed in various ways: round brackets: shows data structure of a given element (ex. it would show 2x2 double) curly brackets: shows the actual data of the given element two sets of round brackets: shows a particular subset of data in the element Cell arrays can be extended by adding a new element outside the size
37
cell()
preallocates an empty cell array of the specified size, ex cell(2,2) makes an empty 2x2
38
celldisp()
shows full contents of cell array
39
cellplot()
visualizes the cell array, strings are displayed with chars as red blocks and whitespaces as white blocks; numbers are displayed as red squares
40
structures
A data type with a name for the entire data structure; individual elements called “fields” could be of different types and they are known by name (not number/position). Group together values+variables that are logically related, STRUCTURES ARE NOT ARRAYS
41
dot operator
allows a structure or structure array to be created one field at a time using assignment statements
42
struct()
allows a structure to be created all at once using struct(‘field_name1’, ‘data_to_go_in_field1’, ‘field_name2’,’data_to_go_in_field2’…etc allows a structure array to be created all at once by using struct for each cell in the structure array
43
structure arrays
an array of structures where each structure has the same names of fields but the data stored in each field can differ
44
fieldnames()
Lists the names of the fields within the structure/structure array
45
rmfield()
removes a field from a structure/structure array and returns the modified structure/structure array. however, it does not change the original value of the structure/structure array.
46
figure object
the highest-level graphics object that controls the window that displays a figure in MATLAB; a figure object can contain different sub-objects.
47
axes object
contained inside a figure object; think of the axes as being layered on top of the figure window; the axes object also can contain a number of different subobjects.
48
plot object
drawn as images (e.g., lines and/or symbols showing data values) on top of the axes.
49
plotting functions
ex. plot() polar() semilogy() When a plotting function is used,MATLAB automatically creates a figure object, an appropriate axes object, and a plot object within the axes
50
get()
examines the current value of an object property
51
set()
writes/sets the value of an object property, requires at least three inputs, object handle, property name, new property value
52
Object handle
a unique numerical nickname given to an object in MATLAB that allows us to refer to the object can assign handles to: figure object, axes object, or individual plot objects. handles are required to get() or set() properties of the object, but you shouldn’t change the handle number
53
gcf()
get current figure command if you haven’t specified a handle
54
gca()
get current axis
55
annotation object
A transparent layer is added to the plot controlled by annotation objects like: arrows and lines, rectangles, legends, text boxes etc
56
images
2D matrices of picture elements (pixels)
57
videos
3D matrices where the third axis is the time dimension
58
image()
displays image object without scaling
59
imagesc()
scales the intensity values to fully use the entire range of the current color map, then displays the resulting image
60
iminfo()
gets the image information: reads standard graphics files and determines what type of data is contained within the file.
61
imread()
reads a file from a standard graphics format
62
axis image
changes axis dimensions to fit the image
63
truecolor images
each pixel has separate intensity values for red green blue: RGB images most flexible option: mxnx3 matrix , m rows, n columns, and 3 pages
64
indexed images
the color of each pixel is identified by a number used to index into a color map to retrieve the corresponding RGB color for the pixel; number of colors in an indexed image is limited by the number of colors in the color map
65
grayscale images
color images where the intensity of the RGB at each pixel is exactly the same; each pixel is a shade of grey (black at 0 intensity to white at max intensity)
66
colour map
an n x 3 look-up table whose n rows correspond to a finite number of defined colors if an indexed or grayscale image uses double real values, they are first rounded to an integer row index; if they use uint8 or uint16 values, then 0 refers to first row, 1 to second row and so on
67
first electronic computers
1940's
68
CPU
Central Processing Unit: brain of the computer. Retrieves binary instructions and data from memory and then executes instructions to provide binary data results
69
ALU
Arithmetic Logic Unit | handles mathematical and logical operators
70
CU
Control unit, decodes instructions and sends signals
71
Network interface
Connects a computer through a local area network (LAN) to the internet (the network cloud)
72
Primary Storage (RAM)
Random Access Memory Usually fast electronic memory (in chip form) Can store a relatively limited amount of information Used to store programs and data the processor is currently working with Volatile: loses data if power is turned off
73
Secondary Storage
Slower to access than primary Can store much more than primary Stores programs and data the processor is currently using Non-volatile: retains information stored on it even when power is off
74
PC
Program Counter | a special memory in the CPU that keeps track of the location in memory of the next thing to be executed
75
Application Software
Software packages designed and developed by other software engineers; commercial or freeware products
76
Compilers / Interpreters
Special programs that translate user programs from human-readable from to computer-readable form so they can be executed on the CPU
77
OS
Operating System | manages the use of computer resources and simplifies appearance with respect to users and other software
78
Interpreted Programming Languages
ex MATLAB translated into binary line by line as the code is run by the CPU no deed to run the compiler with the program before running the program program can easily be changed and rerun slower execution speed small delay every time a program line is encountered
79
Compiled Programming Languages
translated once by compilers before anything is executed, then the binary code is executed
80
Software Development Process
1. Requirements Specification 2. Analysis 3. Software Design 4. Implementation/Coding 5. Testing 6. Maintenance