Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
script - matlabthe script is a series of matlab instructions which is stored in a file and saved the contents of a script can be showed in the
show the output - algorithmswhere does the output go the two possibilities are i to an external file or ii to a window on the screen based on system
compute the resultto compute the area the formula is required in this situation the area of the circle is pi multiplied by the radius squared
obtain the input - algorithmsfrom where does the input come the two possible choices would be from an external file on a disk or from the user who
algorithmsbefore writing any computer program it is very useful to first outline the steps which will be essential an algorithm is the series of
indexed empty matrixthe individual elements cannot be eliminated from matrices as matrices always have the similar number of elements in every
illustration of empty vectorsthe empty vectors can also be used to delete elements from the arrays for illustration to remove the third element from
empty vectorsan empty vector or in another words a vector which stores no values can be generated using the empty square bracketsgtgt evec evec
using functions with the vectors and matricesas matlab is written to work with the vectors and matrices the whole vector or matrix can be passed as
changing dimensionsin addition to transpose operator the matlab has some built-in functions which change the dimensions or configuration of matrices
size function - dimensions of matrixfor the matrix mat shown next it has three rows and two columns therefore the size is 3 times 2 the length is the
dimensions - matrixthe size and length functions in the matlab are used to find array dimensions length function returns the number of elements in
expand a matrixto expand a matrix an individual element could not be added as that would mean there would no longer be the similar number of values
example of linear indexingfor illustration the following substitutes the whole second row with values from a vector the whole row or column could
linear indexingthis is termed as linear indexing it is generally much better style when working with the matrices to refer to the row and column
illustration of modifying the matrix elementsif a single index is used with the matrix the matlab unwinds the matrix column by column for
refer the subset of a matrixit is also possible to refer to the subset of a matrix for illustration this refers to the first amp second rows second
referring to and modifying the matrix elementsto refer to matrix elements the row and then the column indices are given in parentheses always the row
functions to create special matricesthe matlab also has various functions which create special matrices for illustration the zeros function generates
matrices of random numbersthe matrices of random numbers can be generated using the rand and randint functions the first two arguments in the randint
creating matrix variables- argumentsthe cat arguments dimensions are not reliablethe iterators can also be used for the values on the rows by using
creating matrix variablescreating a matrix variable is actually just a generalization of creating a row and column vector variables that is the
creating column vectorsone way to generate a column vector is by explicitly putting the values in square brackets separated by the semicolonsgtgt c
example of referring elementsthe vector can also be extended for illustration the following generates a vector which has three elements and then