Logical Subscripting

May 10th, 2010 No Comments   Posted in Functions

The logical vectors created from logical and relational operations can be used to reference
subarrays. Suppose X is an ordinary matrix and L is a matrix of the same size that is the
result of some logical operation. Then X(L) specifies the elements of X where the
elements of L are nonzero. Read More

The find Function

May 9th, 2010 No Comments   Posted in Functions

The find function determines the indices of array elements that meet a given logical
condition. In its simplest form, find returns a column vector of indices. Transpose that
vector to obtain a row vector of indices. For example, Read More

The magic Function

May 8th, 2010 No Comments   Posted in Functions

MATLAB actually has a built-in function that creates magic squares of almost any size.
Not surprisingly, this function is named magic. Read More

Subscripts

May 7th, 2010 No Comments   Posted in Functions

The element in row i and column j of A is denoted by A(i,j). For example, A(4,2) is the number in the fourth row and second column. For our magic square, A(4,2) is 15. So it is possible to compute the sum of the elements in the fourth column of A by typing Read More

bsxfun

December 6th, 2009 No Comments   Posted in Functions

bsxfun – Apply element-by-element binary operation to two arrays with singleton expansion enabled
Syntax Read More

arrayfun

December 5th, 2009 No Comments   Posted in Functions

arrayfun – Apply function to each element of array Read More

idivide

December 5th, 2009 No Comments   Posted in Functions

idivide – Integer division with rounding option
Syntax Read More