Difference between revisions of "Appendix H: Matlab object overloads"
(removed index entry for deleted function ksubplot.m (removed per IK instruction 2026-08-30)) |
|||
| (17 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| − | ''Spinach'' | + | ''Spinach'' overloads a few operations in Matlab and offers replacements for a few functions. This section contains a list of those overloads and operations. |
==Structures== | ==Structures== | ||
| Line 9: | Line 9: | ||
==Cell arrays== | ==Cell arrays== | ||
| − | [[cell/ | + | [[cell/blkdiag.m]] - block-diagonal cell array from two cell arrays. |
| + | |||
| + | [[cell/complex.m]] - make cell array elements complex. | ||
| + | |||
| + | [[cell/inflate.m]] - inflates every polyadic in a cell array. | ||
[[cell/minus.m]] - element-wise subtraction. | [[cell/minus.m]] - element-wise subtraction. | ||
| Line 15: | Line 19: | ||
[[cell/mtimes.m]] - element-wise multiplication by a matrix. | [[cell/mtimes.m]] - element-wise multiplication by a matrix. | ||
| + | [[cell/times.m]] - element-wise multiplication by a scalar. | ||
| + | |||
| + | [[cell/plus.m]] - element-wise addition. | ||
| + | |||
| + | [[cell/totsum.m]] - a sum across all dimensions of a cell array. | ||
| + | |||
| + | ==Function replacements== | ||
| + | |||
| + | [[kbox.m]] - tickless boxed frame around the current axes. | ||
| + | |||
| + | [[kcolourbar.m]] - LaTeX ticks and label on the standard colour bar. | ||
| + | |||
| + | [[kgrid.m]] - grey (rather than black-and-transparent) coordinate system grid. | ||
| + | |||
| + | [[kfigure.m]] - figure window creation with Spinach plotting defaults. | ||
| + | |||
| + | [[klegend.m]] - LaTeX legend. | ||
| + | |||
| + | [[ktitle.m]] - bold LaTeX title. | ||
| + | |||
| + | [[ksgtitle.m]] - LaTeX title for a grid of plots | ||
| + | |||
| + | [[kxlabel.m]] - LaTeX ticks and label on the standard X axis. | ||
| + | |||
| + | [[kxtickfix.m]] - engineering notation for X axis tick labels. | ||
| + | |||
| + | [[kylabel.m]] - LaTeX ticks and label on the standard Y axis. | ||
| + | |||
| + | [[kytickfix.m]] - engineering notation for Y axis tick labels. | ||
| + | |||
| + | [[kzlabel.m]] - LaTeX ticks and label on the standard Z axis. | ||
| + | |||
| + | [[kztickfix.m]] - engineering notation for Z axis tick labels. | ||
| + | |||
| + | ==RCV sparse matrices== | ||
| + | |||
| + | [[rcv/ctranspose.m]] - conjugate transpose of an RCV sparse matrix. | ||
| + | |||
| + | [[rcv/gather.m]] - gathers an RCV sparse matrix from GPU. | ||
| + | |||
| + | [[rcv/gpuArray.m]] - transfers an RCV sparse matrix to GPU. | ||
| + | |||
| + | [[rcv/horzcat.m]] - horizontal concatenation for RCV sparse matrices. | ||
| + | |||
| + | [[rcv/kron.m]] - Kronecker product between two RCV sparse matrices. | ||
| + | |||
| + | [[rcv/nnz.m]] - number of non-zero elements in an RCV sparse matrix. | ||
| + | |||
| + | [[rcv/size.m]] - size of an RCV sparse matrix. | ||
| + | |||
| + | [[rcv/spy.m]] - sparsity pattern plot for an RCV sparse matrix. | ||
| + | |||
| + | [[rcv/vertcat.m]] - vertical concatenation for RCV sparse matrices. | ||
| + | |||
| + | [[rcv/full.m]] - Converts an RCV sparse matrix into a full matrix. | ||
| + | |||
| + | [[rcv/minus.m]] - Subtracts one RCV object from another. | ||
| + | |||
| + | [[rcv/mtimes.m]] - Multiplication for RCV sparse matrices. | ||
| + | |||
| + | [[rcv/plus.m]] - Adds things to RCV sparse matrices. | ||
| + | |||
| + | [[rcv/rcv.m]] - Creates an RCV (row-column-value storage) sparse matrix. | ||
| + | |||
| + | [[rcv/rdivide.m]] - Divides an RCV sparse matrix by a numeric scalar. | ||
| + | |||
| + | [[rcv/sparse.m]] - Converts an RCV sparse matrix into a Matlab sparse. | ||
| + | |||
| + | [[rcv/times.m]] - Multiplies an RCV sparse matrix by a numeric scalar. | ||
| + | |||
| + | [[rcv/transpose.m]] - The transpose of an RCV sparse matrix. | ||
| + | |||
| + | ==Miscellaneous== | ||
| + | |||
| + | [[double/inflate.m]] - polyadic inflation, skips when it sees a double | ||
| − | ''Version 2. | + | ''Version 2.9, authors: [[Ilya Kuprov]]'' |
Latest revision as of 10:11, 30 August 2026
Spinach overloads a few operations in Matlab and offers replacements for a few functions. This section contains a list of those overloads and operations.
Structures
struct/plus.m - field-wise addition.
struct/mtimes.m - field-wise multiplication by a matrix.
Cell arrays
cell/blkdiag.m - block-diagonal cell array from two cell arrays.
cell/complex.m - make cell array elements complex.
cell/inflate.m - inflates every polyadic in a cell array.
cell/minus.m - element-wise subtraction.
cell/mtimes.m - element-wise multiplication by a matrix.
cell/times.m - element-wise multiplication by a scalar.
cell/plus.m - element-wise addition.
cell/totsum.m - a sum across all dimensions of a cell array.
Function replacements
kbox.m - tickless boxed frame around the current axes.
kcolourbar.m - LaTeX ticks and label on the standard colour bar.
kgrid.m - grey (rather than black-and-transparent) coordinate system grid.
kfigure.m - figure window creation with Spinach plotting defaults.
klegend.m - LaTeX legend.
ktitle.m - bold LaTeX title.
ksgtitle.m - LaTeX title for a grid of plots
kxlabel.m - LaTeX ticks and label on the standard X axis.
kxtickfix.m - engineering notation for X axis tick labels.
kylabel.m - LaTeX ticks and label on the standard Y axis.
kytickfix.m - engineering notation for Y axis tick labels.
kzlabel.m - LaTeX ticks and label on the standard Z axis.
kztickfix.m - engineering notation for Z axis tick labels.
RCV sparse matrices
rcv/ctranspose.m - conjugate transpose of an RCV sparse matrix.
rcv/gather.m - gathers an RCV sparse matrix from GPU.
rcv/gpuArray.m - transfers an RCV sparse matrix to GPU.
rcv/horzcat.m - horizontal concatenation for RCV sparse matrices.
rcv/kron.m - Kronecker product between two RCV sparse matrices.
rcv/nnz.m - number of non-zero elements in an RCV sparse matrix.
rcv/size.m - size of an RCV sparse matrix.
rcv/spy.m - sparsity pattern plot for an RCV sparse matrix.
rcv/vertcat.m - vertical concatenation for RCV sparse matrices.
rcv/full.m - Converts an RCV sparse matrix into a full matrix.
rcv/minus.m - Subtracts one RCV object from another.
rcv/mtimes.m - Multiplication for RCV sparse matrices.
rcv/plus.m - Adds things to RCV sparse matrices.
rcv/rcv.m - Creates an RCV (row-column-value storage) sparse matrix.
rcv/rdivide.m - Divides an RCV sparse matrix by a numeric scalar.
rcv/sparse.m - Converts an RCV sparse matrix into a Matlab sparse.
rcv/times.m - Multiplies an RCV sparse matrix by a numeric scalar.
rcv/transpose.m - The transpose of an RCV sparse matrix.
Miscellaneous
double/inflate.m - polyadic inflation, skips when it sees a double
Version 2.9, authors: Ilya Kuprov