Final Review Flashcards

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
Q

strcmpi()

A

determines whether or not two strings are 1. equal in length and 2. contain the same characters but ignores upper vs lowercase

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

strncmp()

A

determines whether two strings contain the same n leading characters

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

strncmpi()

A

determines whether two strings contain the same n leading characters, ignores upper vs lowercase

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

findstr(‘string’, ‘substring’)

A

finds the starting position of ALL occurrences of a substring within an identified string

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

strmatch()

A

finds the rows in an array that match the given substring, returns them like:
result = strmatch(‘substring’, string_variable)
result =
1
2

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

strrep(string_variable, ’substring_to_be_replaced’,’new_substring’)

A

finds and replaces all occurrences of the first listed substring with the second one

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

upper()

A

modifies a string by converting all lower case letters to upper case

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

lower()

A

modifies a string by converting all upper case letters to lower case

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

int2str()

A

converts a numerical value of type double into the corresponding string (type char)

34
Q

num2str()

A

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
Q

sprintf

A

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
Q

cell array

A

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
Q

cell()

A

preallocates an empty cell array of the specified size, ex cell(2,2) makes an empty 2x2

38
Q

celldisp()

A

shows full contents of cell array

39
Q

cellplot()

A

visualizes the cell array, strings are displayed with chars as red blocks and whitespaces as white blocks; numbers are displayed as red squares

40
Q

structures

A

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
Q

dot operator

A

allows a structure or structure array to be created one field at a time using assignment statements

42
Q

struct()

A

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
Q

structure arrays

A

an array of structures where each structure has the same names of fields but the data stored in each field can differ

44
Q

fieldnames()

A

Lists the names of the fields within the structure/structure array

45
Q

rmfield()

A

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
Q

figure object

A

the highest-level graphics object that controls the window that displays a figure in MATLAB; a figure object can contain different sub-objects.

47
Q

axes object

A

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
Q

plot object

A

drawn as images (e.g., lines and/or symbols showing data values) on top of the axes.

49
Q

plotting functions

A

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
Q

get()

A

examines the current value of an object property

51
Q

set()

A

writes/sets the value of an object property, requires at least three inputs,
object handle, property name, new property value

52
Q

Object handle

A

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
Q

gcf()

A

get current figure command if you haven’t specified a handle

54
Q

gca()

A

get current axis

55
Q

annotation object

A

A transparent layer is added to the plot controlled by annotation objects like:
arrows and lines, rectangles, legends, text boxes etc

56
Q

images

A

2D matrices of picture elements (pixels)

57
Q

videos

A

3D matrices where the third axis is the time dimension

58
Q

image()

A

displays image object without scaling

59
Q

imagesc()

A

scales the intensity values to fully use the entire range of the current color map, then displays the resulting image

60
Q

iminfo()

A

gets the image information: reads standard graphics files and determines what type of data is contained within the file.

61
Q

imread()

A

reads a file from a standard graphics format

62
Q

axis image

A

changes axis dimensions to fit the image

63
Q

truecolor images

A

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
Q

indexed images

A

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
Q

grayscale images

A

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
Q

colour map

A

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
Q

first electronic computers

A

1940’s

68
Q

CPU

A

Central Processing Unit: brain of the computer. Retrieves binary instructions and data from memory and then executes instructions to provide binary data results

69
Q

ALU

A

Arithmetic Logic Unit

handles mathematical and logical operators

70
Q

CU

A

Control unit, decodes instructions and sends signals

71
Q

Network interface

A

Connects a computer through a local area network (LAN) to the internet (the network cloud)

72
Q

Primary Storage (RAM)

A

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
Q

Secondary Storage

A

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
Q

PC

A

Program Counter

a special memory in the CPU that keeps track of the location in memory of the next thing to be executed

75
Q

Application Software

A

Software packages designed and developed by other software engineers; commercial or freeware products

76
Q

Compilers / Interpreters

A

Special programs that translate user programs from human-readable from to computer-readable form so they can be executed on the CPU

77
Q

OS

A

Operating System

manages the use of computer resources and simplifies appearance with respect to users and other software

78
Q

Interpreted Programming Languages

A

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
Q

Compiled Programming Languages

A

translated once by compilers before anything is executed, then the binary code is executed

80
Q

Software Development Process

A
  1. Requirements Specification
  2. Analysis
  3. Software Design
  4. Implementation/Coding
  5. Testing
  6. Maintenance