Prepare for your exams

Study with the several resources on Docsity

Earn points to download

Earn points by helping other students or get them with a premium plan

Guidelines and tips

Prepare for your exams

Study with the several resources on Docsity

Earn points to download

Earn points by helping other students or get them with a premium plan

Community

Ask the community

Ask the community for help and clear up your study doubts

University Rankings

Discover the best universities in your country according to Docsity users

Free resources

Our save-the-student-ebooks!

Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors

PSU CMPSC200 MIDTERM 2024 QUESTIONS & CORRECT ANSWERS. ALREADY GRADED A+..docx QDM Expert Exam Flashcards EXAM NEWEST 2024 ACTUAL EXAM COMPLETE 120 QUESTIONS & CORRECT DETAILED ANSWERS (VERIFIED ANSWERS) GRADED A+.docx

Typology: Exams

2023/2024

1 / 13

Download PSU CMPSC200 MIDTERM 2024 QUESTIONS & CORRECT ANSWERS. ALREADY GRADED A+..docx and more Exams Nursing in PDF only on Docsity! PSU CMPSC200 MIDTERM 2024 QUESTIONS & CORRECT ANSWERS. ALREADY GRADED A+. .* - ANSElement-by-element array multiplication operator .^ - ANSElement-by-element array power operator * - ANSMatrix multiplication operator & - ANSAnd (used with vectors) && - ANSAnd (used with scalars) %c - ANSUsed for displaying just one character %e - ANSExponential notation %f - ANSFixed-point notation %g - ANSUsed for displaying the shorter of fixed-point notation or exponential notation %i - ANSinteger notation %s - ANSUsed for displaying a string of characters ^ - ANSMatrix power operator < - ANSLess than <= - ANSLess than or equal to == - ANSEquality check > - ANSGreater than >= - ANSGreater than or equal to | - ANSOr (used with vectors) || - ANSOr (used with scalars) ~ - ANSNot ~= - ANSNot equal to 0 (zero) is the typical computer science representation for true, while 1 (one) is the typical computer science representation for false. - ANSFalse A matrix with a determinant that is non-zero - ANSA matrix for which an inverse does not exist A stiff equation is a differential equation where some numerical solution approaches are numerically stable unless you use extremely small step sizes. - ANSFalse alpha( ) - ANSUsed to adjust the transparency of a graphics object An array cannot contain multiple pieces of information. - ANSFalse animatedline( ) - ANSCreates a line animation Annotation axes - ANSEnables one to insert annotation objects such as lines, legends, and text boxes onto a figure Arithmetic and Logic Unit (ALU) - ANSPerforms mathematical operations Array - ANSContainer for multiple pieces of orderly information At the end of a for loop, the loop index variable keeps its most recent value. - ANSTrue axis( ) - ANSUsed to control the axes of a plot Bit - ANSOne 0 or 1 break - ANSUsed to cause the termination of the smallest enclosing for loop or while loop break and continue are "go-to" techniques that all programmers should readily use. - ANSFalse Built-in backslash operator approach for solving systems of linear equations - ANSsolution = A\b Byte - ANSEight 0 or 1's camlight( ) - ANSUsed to adjust lighting Cell array constructors - ANSCurly braces: { and } Extrapolation - ANSConstructs estimated new data points beyond the range of a data set factor( ) - ANSFactors the expression false - ANSThe logical value 0 Field - ANSCan be thought of as a property fieldnames( ) - ANSAllows one to see the name of the fields figure( ) - ANSCalls a figure, creating it if necessary fimplicit( ) - ANSPlots implicit 2D plots Flowchart - ANSGrapgical representation of how code flows or progresses fmesh( ) - ANSPlots wireframe meshes fplot( ) - ANSPlots 2D plots fplot3( ) - ANSPlots 3D plots fprintf( ) - ANSUsed for printing output to the screen or to a file, and generally has formatting capabilities fsurf( ) - ANSPlots surface plots fzero( ) - ANSUsed for finding roots get( ) - ANSEnables one to acquire graphics object properties ginput( ) - ANSUsed to get data points from a plot gradient( ) - ANSUsed for creating finite differences Handle graphics - ANSThe components of the GUI are stored as properties relating to this idea horzcat( ) - ANSConcatenates horizontally How many counters can be used within a single program? - ANSAs many as the programmer would want or need imread( ) - ANSReads an image from a file imwrite( ) - ANSUsed to save an image to a file In computer science, what are the main kinds of repetition structures? - ANS1. for loop 2. while loop 3. do while loop In general, variables in MATLAB are either local or global in scope. - ANSTrue In MATLAB, loops should not be your first choice programming technique if there are other reasonable alternatives. - ANSTrue Indexed image - ANSSimilar to "paint by numbers" Infinite loop - ANSA loop that never stops running input( ) - ANSUsed to request input from the user int( ) - ANSUsed to calculate symbolic derivatives integral( ) - ANSUses an adaptive quadrature approach to approximate the integral Intensity image - ANSImage colors are determined by a colormap interp1( ) - ANSUnivariate interpolation interp2( ) - ANSTwo dimensional interpolation interp3( ) - ANSThree dimensional interpolation Interpolation - ANSConstructs estimated new data points within the range of a data set It is a best practice to fit high degree polynomial curve fits to data sets, especially if one knows that the data set for one reason or another likely represents low degree polynomial data. - ANSTrue It is possible to have no inputs to a function, one input to a function, or multiple inputs to a function. - ANSTrue It is possible to have no outputs from a function, one output from a function, or multiple outputs from a function. - ANSTrue Left Riemann sum - ANSApproximates the function by its value at the left-end point legend( ) - ANSCreates a legend for a plot Letters - ANSCharacter data ln(x) - ANSNot a valid MATLAB command log(x) - ANSlog base e of x log10(x) - ANSlog base 10 of x loglog( ) - ANSPlots logarithm of y vs. logarithm of x Main Memory - ANSStores programs and program data into random access memory Mathematical function - ANSA mathematical relationship that maps an input to an output MATLAB array indexes must be positive integers. - ANSTrue MATLAB defaults to the behavior of hidden on unless hidden off is specified. - ANSTrue MATLAB function files are .m files like scripts are. - ANSTrue MATLAB generally interprets computer code line by line from the top to the bottom of a program. - ANSTrue MATLAB's desktop environment is an example of a GUI. - ANSTrue Matrix - ANS2D numeric array used in linear algebra with special mathematical properties Matrix inverse approach for solving systems of linear equations - ANSsolution = inv(A)*b Middle Riemann sum - ANSApproximates the function by its value at the middle point of the subinterval Most efficient approach computationally in MATLAB for solving systems of linear equations - ANSsolution = A\b nargin( ) - ANSDetermines the number of input arguments nargout( ) - ANSDetermines the number of output arguments Neglecting the possibility of else or elseif cases, a while loop can be thought of like a repetitious if statement. - ANSTrue Non-volatile Memory - ANSPermanant data storage num2str( ) - ANSConverts numbers to a character array Some functions can have different behavior based on how they are used. - ANSTrue sprintf( ) - ANSUsed for printing output to a text string, and generally has formatting capabilities Static text box - ANSUsed for displaying text to the user String - ANSAn example of a character array Structure array - ANSThe MATLAB-created .m file uses this concept to pass information around the GUI-involved program Subfunctions - ANSThe MATLAB-created .m file uses this concept to organize the sections of the GUI-involved program subs( ) - ANSUsed to substitute in numbers, symbols, or other variable name(s) surf( ) - ANSPlots a 3D surface plot Switches can only check for equality, while if statements can check for equality or inequality. - ANSTrue syms - ANSDeclares a variable as a symbol The choice between numerical integration approaches depends on what the data looks like and what computational expense you can tolerate. - ANSTrue The default angular unit in MATLAB is radians unless specified otherwise. - ANSTrue The difference between for loops, while loop, and do while loops is that for loops ________, while loops _______, and do while loops _______, - ANS1. repeat a block of code a fixed number of times 2. evaluate a condition before deciding if a block of code is to be run or repeated 3. execute a block of code, then evaluate a condition to decide if the block of code should be repeated The dimensions of the result from a matrix multiplication operation are determined by the outer dimensions of the two matrices being multiplied. - ANSTrue The do while loop is a useful built-in feature of the MATLAB programming language. - ANSFalse The fact that a global variable is both visible and modifiable to all parts of a program is both an advantage and a disadvantage. - ANSTrue The input (or output) order must be consistent between a function and whatever calls it. - ANSTrue The input( ) command can be used to acquire numeric input from the user. The input( ) command can also be used to acquire character input from the user. - ANSTrue The key difference between animations and movies is that animations ______________ while movies ________________ - ANS1. are drawn live with no archiving 2. enable archiving The key parts to every function are: - ANS1. The name of the function 2. The outputs from the function, if applicable 3. Comments that describe the other parts of the function 4. The inputs to the function, if applicable The modern approach for symbolically solving ODEs in MATLAB is to use symbolic functions as an input into the built-in differential equation solver command. - ANSTrue The result of a matrix multiplication operation is mathematically defined if the inner dimensions of the two matrices being multiplied are not equal to each other. - ANSFalse The semi-colon at the end of a line of code is generally an optional piece of syntax in the MATLAB programming language. - ANSTrue There are sometimes multiple valid ways to solve the same programming tasks. - ANSTrue There are three primary steps for writing to a file with fprintf(). Which of the following are those steps? - ANS1. Write to the file 2. Close the file 3. Open the file, creating it if necessary tic and toc( ) - ANSUsed as a stopwatch feature title( ) - ANSAdds a title to a plot To use MATLAB's built-in numerical ODE solver, one must convert the ordinary differential equation or the system of ordinary differential equations into state-space form. For the purpose of this question, disregard the special case where one is numerically solving a single ODE that is first order. - ANSTrue Transposition (disregard the case of complex numbers) - ANSInterchanges the rows and columns Trapezoidal rule - ANSApproximates the function by its value at the middle point of the subinterval trapz( ) - ANSUses the trapezoidal method to fit trapezoids under the curve as an approximation of the area true - ANSThe logical value 1 type____ - ANSDisplays the contents of some files or functions Univariate differentiation can be thought of physically as the area under a curve. - ANSFalse Used for operations on sets of cells - ANSParentheses: ( and ) Variables are global in scope by default; one must use a special technique to declare a variable to be local in scope. - ANSFalse vertcat( ) - ANSConcatenates vertically Volatile Memory - ANSTemporary data storage What happens when you have a for loop inside of another for loop? - ANSThe inside for loop is fully executed before the second iteration of the outer for loop What is the purpose of a graphics handle? - ANSProvides a unique identifier for a plot, figure, or axis When it appears in a programming language, which of the following are possible do while loop scenarios? - ANS1. The loop runs exactly once 2. The loop never stops running When it appears in a programming language, which of the following are possible while loop scenarios? - ANS1. The loop runs exactly once 2. The loop never runs 3. The loop never stops running When the MATLAB interpreter reports an error it does not stop the execution of your code. - ANSFalse When utilizing a MATLAB built-in ODE solver, in the function for one's states the variable for the state derivatives must be organized as a column vector. - ANSTrue Which built-in command returns the largest number of elements in any dimension of a variable? - ANSlength( )

Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved