CMPSC 200 FINAL EXAM VERIFIED STUDY GUIDE
MATLAB name meaning - Answers - "MATrix LABoratory"
Meshgrid - Answers - Function that facilitates calculations with two variables that are
row arrays by creating two 2-dimensional arrays that can be used for the operation.
Format of a function .m file - Answers - function [ result ] = functionname( variable
inputs)
% description of function
% input, output, processing steps
calculations
result = ;
end
disp - Answers - function that may be used to output value(s) stored in an array. Can
only combine text and numbers if you cnovert one to the other.
Not much control over the format.
num2str(a) - Answers - converts number to string so as to display both together in a
single display
fprintf - Answers - Formatted Output - function that allows more control over the
display of an output.
general format: fprint(text with placeholders %f, variables)
ginput - Answers - function that allows users to extract information from a graph
ginput(n) specifies how many points (n) can be extracted from the graph
uiimport - Answers - opens the import wizard
xlsread - Answers - reads data from an excel file
xlswrite - Answers - writes files for use in excel
3 types of control structures - Answers - Sequence, Selection, and Repetition
Relational Operators - Answers - < less than
<= less than or equal to
> greater than
, >= greater than or equal to
~= not equal to
== equal to
Logical Operators - Answers - | or, if either condition is true, the combination is true
& and, if both conditions are true, the combination is true
~ not, reverses the truth of the condition
xor if one of the conditions is true, but not both, the combination is true
| or truth table - Answers - Cond1 | Cond2 Result
TTT
TFT
FTT
FFF
& and truth table - Answers - Cond1 & Cond2 Result
TTT
TFF
FTF
FFT
xor xor truth table - Answers - Cond1 xor Cond2 Result
TTF
TFT
FTT
FFF
Logical Functions - Answers - Find, All, Any
find - Answers - returns the index of the elements of the array that meet the condition
all - Answers - returns true if all the elements of the array meets the condition,
otherwise returns false
any - Answers - returns true if any of the elements of the array meet the condition,
otherwise returns false
Sequence Structure - Answers - commands are executed one right after another in
the exact order they are written
Selection Structure - Answers - one sec of commands is executed when a condition
is true and another set if the condition is false
Repetition Structure - Answers - set of commands that are issued over an over again
(loops)
"If" Selection Structure - Answers - if (condition)
statements to be executed if true
elseif (condition)
statements to be executed if condition2 is true
MATLAB name meaning - Answers - "MATrix LABoratory"
Meshgrid - Answers - Function that facilitates calculations with two variables that are
row arrays by creating two 2-dimensional arrays that can be used for the operation.
Format of a function .m file - Answers - function [ result ] = functionname( variable
inputs)
% description of function
% input, output, processing steps
calculations
result = ;
end
disp - Answers - function that may be used to output value(s) stored in an array. Can
only combine text and numbers if you cnovert one to the other.
Not much control over the format.
num2str(a) - Answers - converts number to string so as to display both together in a
single display
fprintf - Answers - Formatted Output - function that allows more control over the
display of an output.
general format: fprint(text with placeholders %f, variables)
ginput - Answers - function that allows users to extract information from a graph
ginput(n) specifies how many points (n) can be extracted from the graph
uiimport - Answers - opens the import wizard
xlsread - Answers - reads data from an excel file
xlswrite - Answers - writes files for use in excel
3 types of control structures - Answers - Sequence, Selection, and Repetition
Relational Operators - Answers - < less than
<= less than or equal to
> greater than
, >= greater than or equal to
~= not equal to
== equal to
Logical Operators - Answers - | or, if either condition is true, the combination is true
& and, if both conditions are true, the combination is true
~ not, reverses the truth of the condition
xor if one of the conditions is true, but not both, the combination is true
| or truth table - Answers - Cond1 | Cond2 Result
TTT
TFT
FTT
FFF
& and truth table - Answers - Cond1 & Cond2 Result
TTT
TFF
FTF
FFT
xor xor truth table - Answers - Cond1 xor Cond2 Result
TTF
TFT
FTT
FFF
Logical Functions - Answers - Find, All, Any
find - Answers - returns the index of the elements of the array that meet the condition
all - Answers - returns true if all the elements of the array meets the condition,
otherwise returns false
any - Answers - returns true if any of the elements of the array meet the condition,
otherwise returns false
Sequence Structure - Answers - commands are executed one right after another in
the exact order they are written
Selection Structure - Answers - one sec of commands is executed when a condition
is true and another set if the condition is false
Repetition Structure - Answers - set of commands that are issued over an over again
(loops)
"If" Selection Structure - Answers - if (condition)
statements to be executed if true
elseif (condition)
statements to be executed if condition2 is true