Mat
Calling sequence
A=[a11, a12, ..., a1n;
a21, a22, ..., a2n;
...
am1, am2, ...; amn]
|
Parameters
Description
The Bmat data type is a matrix made of boolean numbers. A boolean number is either T (true) or
F (false). T is the nsp variable \%t (same as 1==1) and F is the nsp variable \%t (same as 1~=1). In
conditional expressions T is equivalent to any nonzero number and F is equivalent to zero.
Operations on boolean matrices
Methods from the matint interface
- A.redim[m,n] reshape matrix to size mxn. m or n can be set to -1
- A.concatr[B] A = [A,B]
- A.concatd[B] A = [A;B]
- A.perm_elem[p,q[,dim]] permute p and q: elements (default or dim=0), rows (dim=1)
or columns (dim=2).
Extraction, insertion, deletion
- If I and is J are respectively row and column indices A(I,J) is the submatrix of A with
entries in I and j.
- A(I,:) is the submatrix of A with row indices in I.
- A(:,J) is the submatrix of A with comumn indices in I.
- A(:,:) is A
- A(:) is the column matrix obtained by stacking the columns of A.
- If I and is J are row and column indices A(I,J)=B inserts matrix B into matrix A in
rows I and columns J.
- A(I,:)=[] removes the rows of A with indices in J.
- A(:,J)=[] removes the columns of A with indices in J.
Compatibility with numerical matrices
Boolean matrices are converted into numerical matices
with T converted to 1 and F converted to 0. Example of boolean function
- bmat_create : make a boolean matrix.
- b2m : explicit conversion from boolean matrix to numeric matrix.
- m2b : explicit conversion from numeric matrix to boolean matrix.
See also
Authors jpc, bp