
















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!

















's' - ANSComplete the statement to obtain a string from the user rather than a number. userName = input('Sally',_____); " - ANSTwo single quotation marks print a single quotation mark. Note that a single quotation mark alone would instead indicate the end of the format specification. ( ) parenthesis ~ not & and | or left-to-right - ANSlogical operators order of operation [0, 0, 1] & is applied element-wise, yielding [1 & 0, 0 & 0, 1 & 1] = [0, 0, 1] - ANS[1, 0, 1] & [0, 0, 1] yields what new array? [1, 1, 1, 0] - ANS~[0, 0, 0, 1] yields what new array? [3,5;2,4;1,9] - ANSWhat is matrixC after executing the following statement? matrixA = [ 3, 1, 4; 2, 5, 9 ]; matrixC = reshape( matrixA, 3, 2 )
%f - ANSfixed-point %G - ANSeither %f or %E whichever is shorter %g - ANSwither %f or %e whatever is shorter %i - ANSinteger %s - ANSstring | - ANSboolean or ~a or not(a) - ANSNot negates or complements the value of a, returning true if a is false, and vice versa. 0 1 0 - ANS1& 1& 0& 1 0 0 - ANS1 or 0 1 or 1
0 or 0 1x0 - ANSWhat size is the row array created by [4:-2:5]? Type the size as: NxM 65-90 - ANSA-Z 97-122 - ANSa-z a & b or and(a,b) - ANSAnd returns true if a and b are true, meaning both are true. a | b or or(a,b) - ANSOr returns true if a or b is true, meaning either is true (or both). abstraction - ANSthe evolution of computer language is driven by a process ___________. acos - ANSinverse cosine all(inArray) - ANSidentifies whether all array elements are non-zero or true, and false otherwise. Instead of testing elements along the columns, all(inArray, 2) tests along the rows. The function call all(inArray,1) is equivalent to all(inArray). allTrue = true - ANSall true
char(numericArray) - ANSconverts the numeric array numericArray into a character vector charVec2 corresponding to the Unicode transformation format 16 (UTF-16) code. char(stringScalar) - ANSconverts the string scalar stringScalar into a character vector charVec1. clc - ANSClears the command window. Does not affect the workspace, meaning variables are unchanged clear - ANSclears all variables from the workspace, so all variable values are lost. close(n) - ANScloses figure number n comment - ANSThe interpreter ignores all text to the right of "%" on a line, so the programmer can write any text there. compose(formatSpec,arrayIn) - ANSformats the data in arrays arrayIn, using formatting operators specified by formatSpec and returns the resulting text in stringArrayOut. The compose function formats values from arrayIn in column order. contains(String1,TestPattern) - ANSperforms a case-sensitive logical comparison returning 1 (true) if scalar array string1 contains the specified
testPattern, and returns 0 (false) otherwise. If testPattern is a string array containing multiple patterns, then contains returns 1 if string1 contains any element of testPattern. contains(string1, testPattern, 'IgnoreCase',true) ignores case when determining if string1 contains testPattern. cos - ANScosine cosd - ANScosine in argument of degrees cosh - ANShyperbolic cosine cot - ANScotangent count(stringIn, patternSeek) - ANSreturns the number of occurrences of string scalar patternSeek in the string scalar stringIn. count(stringIn, patternSeek, 'IgnoreCase', true) ignores case when counting the number of occurrences of pattern. csc - ANScosecant ctrl-c - ANSWhile not a MATLAB command, this keystroke sequence interrupts an endless MATLAB calculation that a programmer may have entered accidentally. Afterwards, the programmer can enter a new command.
eye - ANSreturns an m by n array aEye with ones on the main diagonal and zeros elsewhere. figure(n) - ANSmakes figure number n the current figure find(inputAr) - ANS______ locates all nonzero elements of inputAr and returns the linear indices of these elements in outLin. If inputAr is a row array, then outLin is a row array; otherwise, outLin is a column array. If the values of the array elements are needed, the statement inputAr(outLin) is used. find(matrixA(:,1) == 2) - ANSIdentify by number the rows in the 2D array matrixA that start with 2. Use the find function. fliplr(A) - ANSflips array left to right flipud(A) - ANSflips array upside down Floating point number - ANSMATLAB stores a real number as a _______. function attendanceValues = ShiftValues(attendanceValues) % Change indexing values attendanceValues(1:3) = attendanceValues(2:1:4);
end - ANSWrite a single statement that shifts row array attendanceValues one position to the left. The rightmost element in shiftedValues also keeps its value. Ex: [10, 20, 30 40] after shifting becomes [20, 30, 40, 40]. gtext - ANSallows positioning of text with the mouse hold off - ANSreleases hold on current plot and allows a new graph to be drawn hold on - ANSallows multiple plots to be superimposed on the same axes i - ANSimaginary unit equal to sqrt(-1) identifier - ANSA variable's name is called an ______. Inf - ANSInfinity input - ANSWhat function obtains a number from a user? input('Enter your age:') - ANSComplete the statement that prompts the user with 'Enter your age: ' and assigns the variable userAge with the user- entered value. UserAge = ___________
isempty(inArray) - ANStests whether inArray is empty. isequal(inArray1,inArray2,....,inArrayN) - ANStests whether input arrays inArray1, inArray2, through inArrayN have the same contents (i.e., whether each array element at each index is equal).All NaN (not a number) values are considered to be NOT equal to each other. isequaln(inArray1,inArray2,....,inArrayN) - ANStests whether input arrays inArray1, inArray2, through inArrayN have the same contents (i.e., whether each array element at each index is equal). All NaN (not a number) values are considered to be equal to each other. isfinite(inArray) - ANSreturns a logical array finiteArray, of the same size as inArray. The value at finiteArray(index) is true when inArray(index) is finite. Otherwise, the values are false. isfinite(x) - ANSReturns true if x is finite; otherwise, returns false. For example, isfinite(Inf) is false, and isfinite(10) is true. isfloat(inArray) - ANStests for floating-point array. isinf(inArray) - ANSreturns a logical array infiniteArray, of the same size as inArray. The value at infiniteArray(index) is true when inArray(index) is infinite. Otherwise, the values are false. isinf(x) - ANSReturns true if x is +Inf or -Inf; otherwise, returns false.
isinteger(inArray) - ANStests for integer array. isletter - ANSReturns the indices of all the alphabetic characters in a string. isletter(charVecIn) - ANSfinds all alphabetic letters in the character vector charVecIn. Returns an array the same size as charArrayIn containing logical true (1) at indices where the elements of charVecIn are letters of the alphabet and logical false (0) where they are not. islogical(inArray) - ANStests for logical array. ismatrix(inArray) - ANStests for 2D arrays. isnan(inArray) - ANSreturns a logical array nanArray, of the same size as inArray. The value at nanArray(index) is true when inArray(index) is NaN. Otherwise, the values are false. isnan(x) - ANSReturns true if x is NaN (Not-a-Number); otherwise, returns false. isnumeric(inArray) - ANStests for numeric array. isprime(inArray) - ANSreturns a logical array primeArray, of the same size as inArray. The value at primeArray(index) is true when inArray(index) is a prime number. Otherwise, the values are false.
'alphanum' for elements that are alphanumeric. 'digit' for elements that are numbers. 'lower' for lowercase characters. 'punct' for Punctuation characters. 'upper' for uppercase characters. 'wspace' for whitespace characters, including {' ', '\t', '\n', '\r', '\v', '\f'}. isvector(inArray) - ANStests for a vector/1D array. j - ANSImaginary unit equal to sqrt(-1), same as i keywords - ANSbreak, else, global, return, case, else if, if, epode,catch, end, otherwise, switch, classdef, for, parlor, try, continue, function, persistent, while length() - ANSreturns the number of elements along the largest dimension of inArray. Often used to find length of a 1D array. literal constant - ANSa number that appears in a statement log - ANSnatural logarithm log10 - ANScommon (base 10) logarithm loglog - ANSLine plot with logarithmic x and y axes.
MATLAB is a high-level language that excels at creating exceptionally fast- executing programs - ANSFalse - it supports scientific and engineering computations MATLAB was developed in the late 1950's - ANSFalse - 1970 NaN - ANSNot-a-Number ndims( ) - ANSreturns the number of array dimensions. ndims(inputArray) - ANS______ returns the number of dimensions in the array inputArray. no conversion specification is needed - ANSTo right justify the output, _________. nthroot - ANSreal n-th root of real numbers numel( ) - ANSreturns the number of array elements. numeric variable - ANSstores a number orient - ANSspecifies the orientation of a figure Overflow - ANSoccurs when the result of a expression exceeds the maximum value that can be stored within a variable.
save dataY y - ANSSuppose the workspace consists of only two variables x = [3, -1, 4] and y = 98.6. Write a command on the command line that only saves the variable y to the file dataY. Do not include the .mat extension. script - ANSa sequence of statements stored in a text file. MATLAB® requires that the name of a script file must end in .m, in order to be executable by the MATLAB interpreter. sec - ANSsecant semilogx - ANSLine plot with logarithmic x and linear y axes semilogy - ANSLine plot with linear x and logarithmic y axes signed 32-bit integer - ANSint signed 8-bit integer - ANSint signed integer - ANSrepresents both positive and negative integer values sin - ANSSine sind - ANSSine of argument in degrees sinh - ANShyperbolic sine
size - ANSrow x column size( ) - ANSreturns the number of rows and number of columns (nRow, nCol) of the array inArray. If only the row dimension is needed, then the programmer should use size(inArray,1). If only the column dimension is needed, then the programmer should use size(inArray,2). size(inputArray) - ANSreturns the size of each dimension of inputArray sort(inArray) - ANSsorts the elements of inArray in ascending order and returns the result in sortOut. For 2D arrays, sort(inArray) sorts each column of inArray in ascending order. To achieve descending order, the function call is sort(inArray,'descend'). sortrows(inArray,colRef) - ANSsorts the array inArray based on the values in column colRef while keeping the rows together. For any rows that have equal elements in a particular column, sorting is based on the column immediately to the right. sprintf(formatSpec,arrayIn1,...,arrayInN) - ANSformats the data in arrays arrayIn1, ..., arrayInN according to the formatSpec, a string scalar, in column order, and returns the results to string scalar stringOut. The sprintf function returns only a string scalar (if the formatSpec is a string scalar) or a character vector (if the formatSpec is a character vector). sqrt - ANSsquare root