Logical Subscripting
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
Matlab Tags: Dürer's, Dürer's magic square, finite, isprime, logical, Logical Subscripting, magic, Subscripting
The 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 row vector of indices. For example, Read More
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 linear algebra. Read More
Working with 8-Bit and 16-Bit Images
8-Bit and 16-Bit Indexed Images
Double-precision (64-bit) floating-point numbers are the default MATLAB representation for numeric data. However, to reduce memory requirements for working with images, you can store images as 8-bit or 16-bit unsigned integers using the numeric classes uint8 or uint16, respectively. An image whose data matrix has class uint8 is called an 8-bit image; an image whose data matrix has class uint16 is called a 16-bit image. Read More
The magic Function
MATLAB actually has a built-in function that creates magic squares of almost any size.
Not surprisingly, this function is named magic. Read More
Matlab Image Types
Indexed Images
An indexed image consists of a data matrix, X, and a colormap matrix, map. map is an m-by-3 array of class double containing floating-point values in the range [0, 1]. Each row of map specifies the red, green, and blue components of a single color. An indexed image uses “direct mapping” of pixel values to colormap values. The color of each image pixel is determined by using the corresponding value of X as an index into map. Values of X therefore must be integers. The value 1 points to the first row in map, the value 2 points to the second row, and so on. Display an indexed image with the statements Read More
The Colon Operator
The colon, :, is one of MATLAB’s most important operators. It occurs in several different
forms. The expression Read More