Tagged: magic

Logical Subscripting

Matlab Logical Subscripting Tutorial 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...

The find Function

Find Function 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...

Linear Algebra

Informally, the terms matrix and array are often used interchangeably. More precisely, a matrix is a two-dimensional numeric array that represents a linear transformation. The mathematical operations defined on matrices are the subject of...

matlab

The magic Function

Matlab MAGIC Function MATLAB actually has a built-in function that creates magic squares of almost any size. Not surprisingly, this function is named magic. B = magic(4) B = 16 2 3 13 5...

The Colon Operator

The colon, :, is one of MATLAB’s most important operators. It occurs in several different forms. The expression 1:10 is a row vector containing the integers from 1 to 10 1 2 3 4...

Subscripts

Subscripts Command 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)...

Computational Advantages

Memory Management Using sparse matrices to store data that contains a large number of zero-valued elements can both save a significant amount of memory and speed up the processing of that data. sparse is...