












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













computer - correct answer ✔a programmable electronic device that can store, retrieve, and process data GIGO - correct answer ✔garbage in, garbage out CPU - correct answer ✔central processing unit 2 components of CPU - correct answer ✔ALU: Arithmetic and Logic Control Unit: fetches next command volatile memory - correct answer ✔fast, temporary storage (RAM, DRAM) non-volatile memory - correct answer ✔slower, permanent storage (ROM, CD) program - correct answer ✔set of instructions to perform specific tasks algorithm - correct answer ✔set of steps for doing something operating system (OS) - correct answer ✔allocated computer resources software - correct answer ✔consists of the OS and other programs used by the computer
high-level language - correct answer ✔easy to understand, hard for computers low-level language - correct answer ✔hard to understand, better for computers machine language - correct answer ✔binary digits (1s, 0s) good for computers compiled languages - correct answer ✔instructions are converted to machine instructions prior to run time then saved as a file which can be run (C++) interpreted languages - correct answer ✔instructions are saved in the same format as they were written and converted to machine instructions at run time, easier to develop (MATLAB) MATLAB - correct answer ✔matrix laboratory GUI - correct answer ✔graphical user interface % - correct answer ✔single line comments %{ %} - correct answer ✔block comments clc - correct answer ✔clears screen
1 - correct answer ✔positive, true 0 - correct answer ✔zero, false -1 - correct answer ✔negative rem(x,y) - correct answer ✔remainder of x divided by y exp(x) - correct answer ✔exponential (e^x) log(x) - correct answer ✔ln(x) log10(x) - correct answer ✔log base 10 of x logb(x) (change of base) - correct answer ✔logd(x)/logd(b) round(x) - correct answer ✔rounds to integers fix(x) - correct answer ✔truncation(removes decimals) floor(x) - correct answer ✔rounds to integer closest to -inf ceiling(x) - correct answer ✔rounds to integer closest to inf
factor(x) - correct answer ✔prime factors of a number x gcd(x,y) - correct answer ✔greatest common denominator of x and y lcm(x,y) - correct answer ✔least common multiple of x and y rats(x) - correct answer ✔converts decimal to fraction factorial(n) - correct answer ✔factorial primes(x) - correct answer ✔find all prime numbers less than or equal to x isprime(x) - correct answer ✔is a number prime (1 for true, 0 for false) trig functions - correct answer ✔sin, asin, sind, asind, sinh, asinh (repeat for all trig) help _____ - correct answer ✔built in help doc _____ - correct answer ✔pop-up help transpose(x) - correct answer ✔flips a matrix over its diagonal mean(x) - correct answer ✔average, when x is a vector it returns the row vector mean of each column
size(x) - correct answer ✔returns the number of rows and columns in x [a,b] = size(x) - correct answer ✔assigns number of rows and columns to a and b respectively length(x) - correct answer ✔largest number of elements in any dimension numel(x) - correct answer ✔total number of elements std(x) - correct answer ✔sample standard deviation std(x,1) - correct answer ✔population standard deviation var(x) - correct answer ✔variance (square of standard deviation) rand(n) - correct answer ✔Uniformly Distributed Pseudorandom Numbers rand(m,n) - correct answer ✔Uniformly Distributed Pseudorandom Numbers with result between 0 and 1 randn(n) - correct answer ✔Normally ("Gaussian") Distributed Pseudorandom Numbers randn(n,m) - correct answer ✔Normally ("Gaussian") Distributed Pseudorandom Numbers with median 0 and variance 1
abs(x) - correct answer ✔absolute value angle(x) - correct answer ✔angle in radians atan2(y,x) - correct answer ✔if in x y coodrinates complex(x,y) - correct answer ✔complex number with x being real and y being imaginary real(x) - correct answer ✔extract real component imag(x) - correct answer ✔extract imaginary component isreal(x) - correct answer ✔is a number real? (0 if x is imaginary, 1 if x is real) conj(x) - correct answer ✔generate complex conjugate realmax - correct answer ✔largest possible floating point number in MATLAB realmin - correct answer ✔smallest possible floating point number in MATLAB intmax - correct answer ✔largest possible integer in MATLAB
zeros(m)/zeros(m,n) - correct answer ✔creates a matrix of zeros ones(m)/ones(m,n) - correct answer ✔creates a matrix of ones diag(A) - correct answer ✔extracts the diagonal of A fliplr(A) - correct answer ✔flips a matrix into its mirror image from left to right flipud(A) - correct answer ✔flips a matrix vertically magic(n) - correct answer ✔Creates a "magic" matrix; constructed from the integers 1 through n^2 with equal row and column sums. n must be a scalar greater than or equal to 3. plot(x1, y1) - correct answer ✔plots y vs. x, different colors are used if more than 1 x-y pair is specified plotyy(x, y1, x, y2) - correct answer ✔plots separate y axes comet(x,y) - correct answer ✔animated version title('some text') - correct answer ✔adds a title xlabel('some text') - correct answer ✔adds x/y/z labels
grid on/grid off - correct answer ✔turns grid lines on and off pause - correct answer ✔pauses the graph (waits for keystroke) pause(time) - correct answer ✔pauses for a certain amount of time figure - correct answer ✔calls new figure figure(n) - correct answer ✔calls a figure n, creating it if it does not already exist hold on/hold off - correct answer ✔freezes the current plot so you can add more plots to it clf - correct answer ✔clears current plot clf(n) - correct answer ✔clears plot n close - correct answer ✔closes current figure close all - correct answer ✔closes all figures title('\alpha') - correct answer ✔greek letters (case sensitive) works with titles, axis labels
histogram(x,nbins) - correct answer ✔histogram where nbins is the number of data bins you would like to have semilogx(x,y) - correct answer ✔logarithmic plots (semilog(logx, normal y)) semilogy(x,y) - correct answer ✔logarithmic plots(semilog(normal x, logy)) loglog(x,y) - correct answer ✔logarithmic plots(loglog(log x, logy)) plot3(x,y,z) - correct answer ✔3D version of plot plot3: comet3(x,y,z) - correct answer ✔animated 3D plot mesh(x,y) - correct answer ✔surface plot: 3D representation of 2D matrices/data mesh plots (if z is included, z gives information about color) surf(x,y) - correct answer ✔surface plot: 3D representation of 2D matrices/data surf plots (if z is included, z gives information about color) colormap('type') - correct answer ✔color maps (see doc colormap) contour(x,y,z) - correct answer ✔contour plots (2D representations of 3D surfaces)
surfc(x,y,z) - correct answer ✔surf plots + contour plots computer functions - correct answer ✔"A piece of computer code that accepts an input argument from the user and provides output to the program" four key parts to a function - correct answer ✔[output] = name (input) comments nargin('') - correct answer ✔determines the number of input arguments (- means there are multiple) nargout('') - correct answer ✔determines the number of output arguments (- means there are multiple) local variables - correct answer ✔- local scope
fprintf - correct answer ✔formatted print function fprintf(format-string, var, ...) %f - correct answer ✔% is a place holder, f is a type field (fixed point notation) %e - correct answer ✔exponential notation %d - correct answer ✔decimal notation %i - correct answer ✔integer notation %g - correct answer ✔the shorter of %f or %e %c - correct answer ✔character notation (one at a time) %s - correct answer ✔string of characters fprintf('blah blah \n') - correct answer ✔new line \r - correct answer ✔carriage return \t - correct answer ✔tab
\b - correct answer ✔backspace %6.2f - correct answer ✔width field: controls minimum number of character to be printed (6) precision field: controls decimal places to be printed (2) sprintf - correct answer ✔similar to fprintf but instead of sending result to command window, it assigns the result a variable name breakpoints - correct answer ✔places in code where execution stops so you can evaluate partial results (must have no syntax errors) ', %, \ - correct answer ✔special fprintf characters manual input data files - correct answer ✔1. Double click on data file
&& - correct answer ✔shortcut and: used with scalars || - correct answer ✔shortcut or: used with scalars pseudocode - correct answer ✔verbal description of code oval - correct answer ✔indicates the beginning or end of a section of code parallelogram - correct answer ✔indicates input or output processes diamond - correct answer ✔indicates a decision point rectangle - correct answer ✔indicates calculations find - correct answer ✔searches a matrix for given search criteria if - correct answer ✔elseif, else, end (can have either elseif or else), once a true statement is found the rest are ignored switch - correct answer ✔case, otherwise, end menu - correct answer ✔whatever = menu('title','option 1','option 2',...) elseif and else if - correct answer ✔are NOT interchangeable
loop characteristics - correct answer ✔low performance good alternatives: array operations, find command, code vectorization three types of loops - correct answer ✔for, while, do loop for loop - correct answer ✔commonly used if you know how many times it needs to be run at the end of the loop, the index variable keeps its most recent value use index 'k', 'i'/'j' are not good in MATLAB because they represent sqrt (-1) when nesting for loops, the inner counter resets every time the loop is reinitialized counter - correct answer ✔a variable that keeps track of some parameter of interest main types: how many, how much break - correct answer ✔causes the termination of the smallest enclosing for or while loop continue - correct answer ✔used to skip the rest of the loop, advancing to the next loop pass