You are on page 1of 3

Array Usual variable can store only one value at any given time.

. Array may be said to be representation of table in programming. A group of related (i.e. same data type) data items that share a common name. A particular value is indicated by writing a number called index number or subscript in brackets (third bracket) just after the array name. Individual values are called elements Format @ Array name is to be given@arrayname is to be declared, it could be of any data type. So integer,character,float everything is ok Declarations: int array name[no of members];char array name[no of members][character length];@ Array no counting starts from zeroint number[3] = {1,4,9}; Mathlab:First declare all variables as symbolic variables. E.g. syms a b c . There is no comma If semicolon is provided at the end, that means this expression will not be displayed in the output screen.

Pointer:Pointers are used when files located in hard disk or else are accessed by C program.In scanf statement, & operator is required to appear before a variable name (except array/string)Save memory space and increase execution speed of the program String: In a string last character is always \n (it is called null character). It is the only way a computer can know where the string ends.Char namas[]={H,i,\0};Easier way to write the above is char name[]= Hi; Notice here double quotation is used.String could be read or displayed using loop with one character as %c specifierOr it could be read or displayed using %s specifier.Scanf is not capable of getting multi word string as it considers space as the end of the string. To overcome this limitation gets() could be used


Total field reserved is total of 5 charactersBy default string things is right justifiedOnly first 2 characters will be displayedTo make left justified a minus may be put like %-5.2s

Strcpy Strcpy may be used with two dimensional string or just one single string. However, usually it is used with two dimensional string. In the two dimensional string, when you are using, the row size notation that is element no is only needed, max character length will be the number provided in the beginning. So it is not required to be included.

Determinant A determinant is a pure number associated with a square matrix. Minor: The minor is for any element in the main matrix. It is the submatrix where row and column containing that specific element Cofactor: Co factor of any element is the ((-1)^(row+column))*minor of that element.Adjoint of a matrix: It is the matrix formed by the co-factors of each element in the original matrix.Inverse of a matrix.: If there A is a n rowed square matrix, then a matrix B, it it exists such that AB=BA= I ,here is the unit matrix, then B is called the inverse matrix of A. It is denoted by A to the power 1.Mathematically, inverse of A = (adjoint of A)/(determinant of A)In normal method determinant of a matrix is obtained by multiplication diagonally and vice vers det. Matrix determinant Syntax r = det(A) Description: det(A) computes the determinant of A, where A is a symbolic or numeric matrix. det(A) returns a symbolic expression, if A is symbolic; a numeric value, if A is numeric. Source: matlab help filefirst bracket,then second bracket and then write first row values with space(comma giving is also ok),then semicolon,after the semicolon second rows value and so on. To get the determinant in the beginning write det Firstly writing the matrix values to a symbolic variable like A is also ok. >> syms x >> diff(x^2,2) ans =2 Here x^2 is differentiated twice, so it is a succesive differentiation