Plan Documentation

Matrix Plans (Paternova™ v.0.9.9)

A matrix is a table of complex numbers consisting of real and imaginary floating-point values. The following functions, or "plans," can be used to create, modify, calculate, read, write, and otherwise manipulate matrices in Paternova.


Get a Matrix

These plans create a matrix using the information provided by the user.


Custom Matrix

Plan to generate a custom matrix.

Description

This plan generates a matrix based on the specified matrix x. The matrix parameter can be specified either as a matrix expression or as a reference to the output matrix in another cell. When a matrix expression is provided, this plan computes the output matrix by evaluating the matrix expression x element by element, with matrix rows separated by semicolons (";") and matrix elements within a row separated by commas (","). All matrix elements are evaluated and stored as complex numbers.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {1,2,3;4-2,5,6;0,7,8}{1,2,3;2,5,6;0,7,8}
x = {1,2;4*2,3^2*cos(pi)}{1,2;8,-9}
x = {(1+I)/I,I*2I;4,exp(pi*I)}{1-I,-2;4,-1}

Fill Matrix

Plan to generate a filled matrix.

Description

This plan fills an m×n matrix with the elements from matrix a. If there are not enough elements available in a, the last element of the last column is used to fill the remainder of the output matrix.

Example

m = {3};n = {2};a = {3}{3,3;3,3;3,3}
m = {3};n = {2};a = {1,3,5}{1,3;1,3;1,3}

Zero Matrix

Plan to generate a matrix of zeros.

Description

This plan generates an m×n matrix of zeros.

Example

m = {3};n = {2}{0,0;0,0;0,0}

Matrix of Ones

Plan to generate a matrix of ones.

Description

This plan generates an m×n matrix of ones.

Example

m = {3};n = {2}{1,1;1,1;1,1}

Identity Matrix

Plan to generate an identity matrix.

Description

This plan generates an identity matrix of size m×m (square), with ones on the main diagonal and zeros elsewhere.

Example

m = {3}{1,0,0;0,1,0;0,0,1}

Diagonal Matrix

Plan to generate a diagonal matrix.

Description

This plan generates a diagonal matrix of size m×m (square) with a[k]+b[k]I in the k-th row of the main diagonal for each k. If k exceeds the bounds of a or b, the last value of each respective array is used. All other elements are set to zero.

Example

m = {3};a = {1,2};b = {0}{1,0,0;0,2,0;0,0,2}
m = {3};a = {1,2,3-6};b = {-2}{1-2I,0,0;0,2-2I,0;0,0,-3-2I}

Skew Diagonal Matrix

Plan to generate a skew diagonal matrix.

Description

This plan generates a skew diagonal matrix of size m×m (square) with a[k]+b[k]I in the k-th row of the main skew diagonal for each k. If k exceeds the bounds of a or b, the last value of each respective array is used. All other elements are set to zero.

Example

m = {3};a = {1,2};b = {0}{0,0,1;0,2,0;2,0,0}
m = {3};a = {1,2,3-6};b = {-2}{0,0,1-2I;0,2-2I,0;-3-2I,0,0}

Generating Expressions

Plan to generate elements with expression.

Description

This plan generates an m×n matrix by evaluating the expression f(i,j) for each element, where i and j are the row and column indices of the element, counted from 0.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

m = {3};n = {2};f = {i*j-2}{-2,-2;-2,-1;-2,0}
m = {3};n = {3};f = {i*I+j}{0,1,2;I,1+I,2+I;2I,1+2I,2+2I}

Convolution Matrix - Box Blur

Plan to generate a box blur filter kernel.

Description

This plan generates an m×n box blur filter kernel matrix used for image convolution.

Example

m = {2};n = {4}{0.125,0.125,0.125,0.125;0.125,0.125,0.125,0.125}

Convolution Matrix - Gaussian Blur

Plan to generate a Gaussian filter kernel.

Description

This plan generates an m×n Gaussian filter kernel matrix used for image convolution, with standard deviations σ_m and σ_n.

Example

m = {3};n = {3};σ_m = {1};σ_n = {0.5}{0.02919,0.21569,0.02919;0.048127,0.35561,0.048127;0.02919,0.21569,0.02919}

Convolution Matrix - Derivative

Plan to generate a derivative filter kernel.

Description

This plan generates an m×n derivative filter kernel matrix used for image convolution, with derivative orders o_m and o_n, and accuracy levels a_m and a_n. This matrix is generated using central finite difference coefficients. Accuracy levels from 0 (corresponding to a 3×3 coefficient matrix for the first-order derivative) up to 3 (corresponding to a 9×9 coefficient matrix for the first-order derivative) are supported.

Example

m = {3};n = {3};o_m = {1};o_n = {1};a_m = {0};a_n = {0}{0.25,0,-0.25;0,0,0;-0.25,0,0.25}
m = {3};n = {3};o_m = {2};o_n = {2};a_m = {0};a_n = {0}{0.0625,-0.125,0.0625;-0.125,0.25,-0.125;0.0625,-0.125,0.0625}

Randomized - Uniform

Plan to randomize elements with standard uniform distribution.

Description

This plan generates an m×n matrix where elements are randomly generated from a continuous uniform distribution between 0 to 1.

Example

m = {2};n = {3}{0.78682,0.71067,0.019271;0.25048,0.94667,0.4049}

Randomized - Standard

Plan to randomize elements with standard normal distribution.

Description

This plan generates an m×n matrix where elements are randomly generated from a normal distribution with mean 0 and variance 1.

Example

m = {2};n = {3}{-2.1356,0.45484,0.1371;0.28382,-1.6828,-1.1253}

Import From Text File Along Rows

Plan to import a matrix from a text file with row indices.

Description

This plan imports a matrix from a text file with the given file name. Matrix rows are separated by new lines, and columns by the specified delimiter. The import starts from column_start. If the rows parameter is not empty, the import is limited to the row indices listed in rows, counted from 0. The imported matrix elements are evaluated as complex expressions.

Example

file name = {tests\mnist_test.csv};delimiter = {,};rows = {1,2,3};column_start = {0}{2,0,0,...;1,0,0,...;0,0,0,...}
file name = {tests\output_mat.txt};delimiter = {,};rows = {};column_start = {1}{2+I,3,4I;10,25-I,42}

Import From Text File Along Columns

Plan to import a matrix from a text file with column indices.

Description

This plan imports a matrix from a text file with the given file name. Matrix rows are separated by new lines, and columns by the specified delimiter. Import starts from row_start. If the columns parameter is not empty, the import is limited to the column indices listed in columns, counted from 0. The imported matrix elements are evaluated as complex expressions.

Example

file name = {tests\data_sample.txt};delimiter = {;};columns = {1,2,4};row_start = {2}{0,2;7,-1}
file name = {tests\output_mat_w.txt};delimiter = {,};columns = {};row_start = {0}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From Armadillo File

Plan to import a matrix from an Armadillo file.

Description

This plan imports a matrix from a file with the given file name after its format is automatically detected by the Armadillo library.

Example

file name = {tests\matrix.bin}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From Armadillo Binary File

Plan to import a matrix from an Armadillo library binary file.

Description

This plan imports a matrix from an Armadillo library binary file with the given file name.

Example

file name = {tests\matrix.bin}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From Armadillo Text File

Plan to import a matrix from an Armadillo library text file.

Description

This plan imports a matrix from an Armadillo library text file with the given file name.

Example

file name = {tests\matrix.txt}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From Armadillo Raw Binary File

Plan to import a matrix from an Armadillo library raw binary file.

Description

This plan imports a column vector from an Armadillo library raw binary file with the given file name.

Example

file name = {tests\matrix.raw_bin}{3.1416;-3.1416;2+I;10;3;25-I;4I;42}

Import From Armadillo Raw Text File

Plan to import a matrix from an Armadillo library raw text file.

Description

This plan imports a matrix from an Armadillo library raw text file with the given file name. In this file format, the matrix dimensions are inferred from the text structure.

Example

file name = {tests\matrix.raw_txt}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From CSV File

Plan to import a matrix from a CSV file.

Description

This plan imports a matrix from a Comma-Separated Values (CSV) file with the given file name.

Example

file name = {tests\matrix.csv}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From Coordinate List File

Plan to import a matrix from a coordinate list file.

Description

This plan imports a matrix from a coordinate list file with the given file name. In this file format, each line describes a nonzero element as "row column value", with row and column indices starting from 0.

Example

file name = {tests\matrix.coord}{3.1416,2+I,3,4I;-3.1416,10,25-I,42}

Import From PGM File

Plan to import a matrix from a PGM file.

Description

This plan imports a matrix from a Portable Gray Map (PGM) file with the given file name. In this file format, the real parts of the elements are stored as integers between 0 and 255.

Example

file name = {tests\matrix.pgm}{3,2,3,0;253,10,25,42}

Convert Arrays Along Rows - Cartesian

Plan to use two arrays to generate the real and imaginary parts of elements row by row.

Description

This plan generates a matrix from the arrays a and b by filling rows of size n. The real part of each element is assigned a value from array a, one after another. Similarly, the imaginary part of each element is assigned a value from array b. Once all values in array a or b have been assigned, the scalars a₀ or b₀ are used, respectively, for the real or imaginary parts.

Example

a = {1,2,3,4,5,6,7};b = {};n = {3};a₀ = {0};b₀ = {0}{1,2,3;4,5,6;7,0,0}
a = {1,2,3,4,5,6,7};b = {3,2,1,0};n = {4};a₀ = {-1};b₀ = {2}{1+3I,2+2I,3+I,4;5+2I,6+2I,7+2I,-1+2I}

Convert Arrays Along Columns - Cartesian

Plan to use two arrays to generate the real and imaginary parts of elements column by column.

Description

This plan generates a matrix from the arrays a and b by filling columns of size m. The real part of each element is assigned a value from array a, one after another. Similarly, the imaginary part of each element is assigned a value from array b. Once all values in array a or b have been assigned, the scalars a₀ or b₀ are used, respectively, for the real or imaginary parts.

Example

a = {1,2,3,4,5,6,7};b = {};m = {3};a₀ = {0};b₀ = {0}{1,4,7;2,5,0;3,6,0}
a = {1,2,3,4,5,6,7};b = {3,2,1,0};m = {4};a₀ = {-1};b₀ = {2}{1+3I,5+2I;2+2I,6+2I;3+I,7+2I;4,-1+2I}

Convert Arrays Along Rows - Polar

Plan to use two arrays to generate the magnitudes and phase angles of elements row by row.

Description

This plan generates a matrix from the arrays r and ϕ by filling rows of size n. The magnitude of each element is assigned a value from array r, one after another. Similarly, the phase angle of each element is assigned a value from array ϕ. Once all values in array r or ϕ have been assigned, the scalars r₀ or ϕ₀ are used, respectively, for the magnitudes or phase angles.

Example

r = {1,2,3,4,5,6,7};ϕ = {};n = {3};r₀ = {0};ϕ₀ = {0}{1,2,3;4,5,6;7,0,0}
r = {1,2,3,4,5,6,7};ϕ = {0,pi,pi/2,pi,0};n = {4};r₀ = {2};ϕ₀ = {-pi/2}{I,-2,3I,-4;5,-6I,-7I,-2I}

Convert Arrays Along Columns - Polar

Plan to use two arrays to generate the magnitudes and phase angles of elements column by column.

Description

This plan generates a matrix from the arrays r and ϕ by filling columns of size m. The magnitude of each element is assigned a value from array r, one after another. Similarly, the phase angle of each element is assigned a value from array ϕ. Once all values in array r or ϕ have been assigned, the scalars r₀ or ϕ₀ are used, respectively, for the magnitudes or phase angles.

Example

r = {1,2,3,4,5,6,7};ϕ = {};m = {3};r₀ = {0};ϕ₀ = {0}{1,4,7;2,5,0;3,6,0}
r = {1,2,3,4,5,6,7};ϕ = {0,pi,pi/2,pi,0};m = {4};r₀ = {2};ϕ₀ = {-pi/2}{I,5;-2,-6I;3I,-7I;-4,-2I}

Convert Array Along Rows - Cartesian

Plan to use an array to generate the real and imaginary parts of elements row by row.

Description

This plan generates a matrix from the array x by filling rows of size n. x[0] and x[1] are assigned to the real and imaginary parts of the first element, respectively. x[2] and x[3] are assigned to the real and imaginary parts of the second element, and so on. Once all values in array x have been assigned, the remaining elements are set to a₀+b₀I.

Example

x = {1,0,2,0,3,0,4,0,5,0,6,0,7};n = {3};a₀ = {0};b₀ = {0}{1,2,3;4,5,6;7,0,0}
a = {1,3,2,2,3,1,4,0,5,0,6,0,7};n = {4};a₀ = {-1};b₀ = {2}{1+3I,2+2I,3+I,4;5,6,7,-1+2I}

Convert Array Along Columns - Cartesian

Plan to use an array to generate the real and imaginary parts of elements column by column.

Description

This plan generates a matrix from the array x by filling columns of size m. x[0] and x[1] are assigned to the real and imaginary parts of the first element, respectively. x[2] and x[3] are assigned to the real and imaginary parts of the second element, and so on. Once all values in array x have been assigned, the remaining elements are set to a₀+b₀I.

Example

x = {1,0,2,0,3,0,4,0,5,0,6,0,7};m = {3};a₀ = {0};b₀ = {0}{1,4,7;2,5,0;3,6,0}
a = {1,3,2,2,3,1,4,0,5,0,6,0,7};m = {4};a₀ = {-1};b₀ = {2}{1+3I,5;2+2I,6;3+I,7;4,-1+2I}

Convert Array Along Rows - Polar

Plan to use an array to generate the magnitudes and phase angles of elements row by row.

Description

This plan generates a matrix from the array x by filling rows of size n. x[0] and x[1] are assigned to the magnitude and phase angle of the first element, respectively. x[2] and x[3] are assigned to the magnitude and phase angle of the second element, and so on. Once all values in array x have been assigned, the remaining elements are set to r₀(cosφ₀+Isinφ₀).

Example

x = {1,0,2,0,3,0,4,0,5,0,6,0,7};n = {3};r₀ = {0};ϕ₀ = {0}{1,2,3;4,5,6;7,0,0}
x = {1,0,2,pi,3,pi/2,4,pi,5,0,6,0,7};n = {4};r₀ = {2};ϕ₀ = {-pi/2}{I,-2,3I,-4;5,6,7,-2I}

Convert Array Along Columns - Polar

Plan to use an array to generate the magnitudes and phase angles of elements column by column.

Description

This plan generates a matrix from the array x by filling columns of size m. x[0] and x[1] are assigned to the magnitude and phase angle of the first element, respectively. x[2] and x[3] are assigned to the magnitude and phase angle of the second element, and so on. Once all values in array x have been assigned, the remaining elements are set to r₀(cosφ₀+Isinφ₀).

Example

x = {1,0,2,0,3,0,4,0,5,0,6,0,7};m = {3};r₀ = {0};ϕ₀ = {0}{1,4,7;2,5,0;3,6,0}
x = {1,0,2,pi,3,pi/2,4,pi,5,0,6,0,7};m = {4};r₀ = {2};ϕ₀ = {-pi/2}{I,5;-2,6;3I,7;-4,-2I}

Convert Image

Plan to generate a matrix from an image.

Description

This plan generates a matrix from the image x. Each matrix element is set by evaluating the expression f(i,j,r,g,b,a). Here, i and j are the row and column indices of the element, counted from 0; and r, g, b, and a are the color channel values (in the 0 to 255 range) of the pixel at row i (the y-coordinate) and column j (the x-coordinate).

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {box(3,3,white)};f = {-1+0.1*r+0.1*g}{50,50,50;50,50,50;50,50,50}
x = {box(3,3,white)};f = {i*r/255+j*I*g/255}{0,I,2I;1,1+I,2+I;2,2+I,2+2I}

Convert Text

Plan to generate a matrix from a text.

Description

This plan generates a matrix from the text x. The matrix rows in x are separated by the specified r_delimiter, while the element tokens in each row are separated by the specified e_delimiter. Each matrix element token is evaluated as a complex expression to generate an element for the output matrix.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {1;2|4;5};e_delimiter = {;};r_delimiter = {|}{1,2;4,5}
x = {1-3 2-sqrt(-1);4 5};e_delimiter = { };r_delimiter = {;}{-2,2-I;4,5}

Convert Text List

Plan to generate a matrix from a text list.

Description

This plan generates a matrix from the text list x. Each text item in the specified text list is assigned to a matrix row, and the element tokens in a row are separated by the specified e_delimiter. Each matrix element token is evaluated as a complex expression to generate an element for the output matrix.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {1;2,4;5};e_delimiter = {;}{1,2;4,5}
x = {1-3 2-sqrt(-1),4 5};e_delimiter = { }{-2,2-I;4,5}


Rearrange a Matrix

These plans produce a matrix by rearranging another matrix.


Copy Matrix

Plan to copy a matrix.

Description

This plan copies all the elements in the matrix x.

Example

x = {1,2,3;4,5,6}{1,2,3;4,5,6}

Replicate Rows

Plan to replicate a matrix in height.

Description

This plan replicates the matrix x in height by repeating each row p times, and then replicates the resulting matrix q times.

Example

x = {1,2;3,4};p = {2};q = {3}{1,2;1,2;3,4;3,4;1,2;1,2;3,4;3,4;1,2;1,2;3,4;3,4}

Replicate Columns

Plan to replicate a matrix in width.

Description

This plan replicates the matrix x in width by repeating each column p times, and then replicates the resulting matrix q times.

Example

x = {1,2;3,4};p = {2};q = {3}{1,1,2,2,1,1,2,2,1,1,2,2;3,3,4,4,3,3,4,4,3,3,4,4}

Resize Matrix

Plan to resize a matrix.

Description

This plan resizes a copy of matrix x to dimensions m×n, without altering its existing elements. If necessary, it trims the sides or pads them with a+bI. If m or n is not specified, that dimension is not modified.

Example

x = {1,2,3;4,5,6};m = {1};a = {-1}{1,2,3}
x = {1,2,3;4,5,6};m = {3};a = {-1}{1,2,3;4,5,6;-1,1,1}
x = {1,2,3;4,5,6};n = {1};a = {-1}{1;4}
x = {1,2,3;4,5,6};n = {4};a = {-1}{1,2,3,-1;4,5,6,1}
x = {1,2,3;4,5,6;7,8,9};m = {2};n = {4};a = {1};b = {3}{1,2,3,1+3I;4,5,6,1+3I}
x = {1,2,3;4,5,6;7,8,9};m = {4};n = {4};a = {1};b = {3}{1,2,3,1+3I;4,5,6,1+3I;7,8,9,1+3I;1+3I,1+3I,1+3I,1+3I}

Transpose

Plan to transpose a matrix.

Description

This plan transposes a copy of the matrix x by flipping it over its main diagonal so that the main diagonal remains unchanged. This operation swaps x[i,j] with x[j,i] for each i and j.

Example

x = {1,2,3;4,5,6}{1,4;2,5;3,6}

Anti-Transpose

Plan to anti-transpose a matrix.

Description

This plan anti-transposes a copy of the matrix x by flipping it over its main skew diagonal so that the main skew diagonal remains unchanged.

Example

x = {1,2,3;4,5,6}{6,3;5,2;4,1}

Mirror Horizontally

Plan to mirror a matrix horizontally.

Description

This plan creates a copy of matrix x and mirrors it horizontally (about the vertical axis), so that the elements in each row are reversed.

Example

x = {1,2,3;4,5,6}{3,2,1;6,5,4}

Mirror Vertically

Plan to mirror a matrix vertically.

Description

This plan creates a copy of matrix x and mirrors it vertically (about the horizontal axis), so that the elements in each column are reversed.

Example

x = {1,2,3;4,5,6}{4,5,6;1,2,3}

Rotate +90°

Plan to rotate a matrix by +90° (90°CCW).

Description

This plan rotates a copy of matrix x by 90° counterclockwise by moving the upper-right corner element to the upper-left corner, and so on.

Example

x = {1,2,3;4,5,6}{3,6;2,5;1,4}

Rotate -90°

Plan to rotate a matrix by -90° (90°CW).

Description

This plan rotates a copy of matrix x by 90° clockwise by moving the upper-right corner element to the lower-right corner, and so on.

Example

x = {1,2,3;4,5,6}{4,1;5,2;6,3}

Rotate 180°

Plan to rotate a matrix by 180°.

Description

This plan rotates a copy of matrix x by 180° by moving the upper-right corner element to the lower-left corner, and so on.

Example

x = {1,2,3;4,5,6}{6,5,4;3,2,1}

Copy Elements

Plan to copy elements.

Description

This plan copies the element of the matrix x at row i[k] and column j[k] for each k. When the lengths of the arrays i and j are different, the last value of the shorter array is used. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9};i = {0,1};j = {0,1,2}{1,2,6}

Submatrix by Inclusion

Plan to create a submatrix by keeping rows and columns.

Description

This plan creates a submatrix of matrix x containing the elements at the specified rows i and columns j.

Example

x = {1,2,3;4,5,6;7,8,9;10,11,12};i = {1,2};j = {3,0}{4;7}
x = {1,2-I,3;4,5I,6;7-3I,8,9};i = {2,0,0};j = {1,0}{8,7-3I;2-I,1;2-I,1}

Submatrix by Exclusion

Plan to create a submatrix by removing rows and columns.

Description

This plan creates a submatrix of matrix x by removing the elements in the specified rows i or columns j.

Example

x = {1,2,3;4,5,6;7,8,9;10,11,12};i = {1,2};j = {3,0}{2,3;11,12}
x = {1,2-I,3;4,5I,6;7-3I,8,9};i = {2,0,0};j = {1,0}{6}

Submatrix with Rows

Plan to create a submatrix of rows.

Description

This plan creates a submatrix of matrix x using the rows with indices specified in i.

Example

x = {1,2,3;4,5,6;7,8,9;10,11,12};i = {1,2,1}{4,5,6;7,8,9;4,5,6}
x = {1,2-I,3;4,5I,6;7-3I,8,9};i = {2,0,0}{7-3I,8,9;1,2-I,3;1,2-I,3}

Submatrix with Columns

Plan to create a submatrix of columns.

Description

This plan creates a submatrix of matrix x using the columns with indices specified in j.

Example

x = {1,2,3;4,5,6;7,8,9;10,11,12};j = {1,2,1}{2,3,2;5,6,5;8,9,8;11,12,11}
x = {1,2-I,3;4,5I,6;7-3I,8,9};j = {2,0,0}{3,1,1;6,4,4;9,7-3I,7-3I}

Crop From Top Left

Plan to crop a submatrix from top left.

Description

This plan copies an m×n submatrix of matrix x, starting from the element at row i and column j, counted from the upper-left corner. If the cropped window does not fit entirely within x, any area outside the matrix is omitted.

Example

x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {2};n = {2};i = {1};j = {1}{6,7;10,11}
x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {1};n = {4};i = {1};j = {1}{6,7,8}

Crop From Top Right

Plan to crop a submatrix from top right.

Description

This plan copies an m×n submatrix of matrix x, starting from the element at row i and column j, counted from the upper-right corner. If the cropped window does not fit entirely within x, any area outside the matrix is omitted.

Example

x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {2};n = {2};i = {1};j = {1}{6,7;10,11}
x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {1};n = {4};i = {1};j = {1}{5,6,7}

Crop From Bottom Left

Plan to crop a submatrix from bottom left.

Description

This plan copies an m×n submatrix of matrix x, starting from the element at row i and column j, counted from the lower-left corner. If the cropped window does not fit entirely within x, any area outside the matrix is omitted.

Example

x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {2};n = {2};i = {1};j = {1}{6,7;10,11}
x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {1};n = {4};i = {1};j = {1}{10,11,12}

Crop From Bottom Right

Plan to crop a submatrix from bottom right.

Description

This plan copies an m×n submatrix of matrix x, starting from the element at row i and column j, counted from the lower-right corner. If the cropped window does not fit entirely within x, any area outside the matrix is omitted.

Example

x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {2};n = {2};i = {1};j = {1}{6,7;10,11}
x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {1};n = {4};i = {1};j = {1}{9,10,11}

Crop From Center

Plan to crop a submatrix from center.

Description

This plan copies an m×n submatrix of matrix x, with a gap of i rows and j columns between the centers. Setting i=j=0 centers the submatrix. When i>0, the submatrix is shifted downward, and when j>0, it is shifted to the right. If the cropped window does not fit entirely within x, any area outside the matrix is omitted.

Example

x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {2};n = {2};i = {0};j = {0}{6,7;10,11}
x = {1,2,3,4;5,6,7,8;9,10,11,12;13,14,15,16};m = {1};n = {4};i = {1};j = {1}{10,11,12}

Remove Rows From Top

Plan to remove rows at indices counted from top.

Description

This plan removes N[k] rows from a copy of matrix x, starting from row i[k], counted from the top for each k. The last value in N is used when k is out of bounds.

Example

x = {1,2,3,2,1;4,5,6,5,4;7,8,9,8,7;4,5,6,5,-4;1,2,3,-2,-1};i = {2,0};N = {3,1}{4,5,6,5,4}
x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2};N = {1}{4,5-I,6}

Remove Rows From Bottom

Plan to remove rows at indices counted from bottom.

Description

This plan removes N[k] rows from a copy of matrix x, starting from row i[k], counted from the bottom for each k. The last value in N is used when k is out of bounds.

Example

x = {1,2,3,2,1;4,5,6,5,4;7,8,9,8,7;4,5,6,5,-4;1,2,3,-2,-1};i = {2,0};N = {3,1}{4,5,6,5,-4}
x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2};N = {1}{4,5-I,6}

Remove Columns From Left

Plan to remove columns at indices counted from left.

Description

This plan removes N[k] columns from a copy of matrix x, starting from column j[k], counted from the left for each k. The last value in N is used when k is out of bounds.

Example

x = {1,2,3,2,1;4,5,6,5,4;7,8,9,8,7;4,5,6,5,-4;1,2,3,-2,-1};j = {2,0};N = {3,1}{2;5;8;5;2}
x = {1,2,3+I;4,5-I,6;7,8,9};j = {0,2};N = {1}{2;5-I;8}

Remove Columns From Right

Plan to remove columns at indices counted from right.

Description

This plan removes N[k] columns from a copy of matrix x, starting from column j[k], counted from the right for each k. The last value in N is used when k is out of bounds.

Example

x = {1,2,3,2,1;4,5,6,5,4;7,8,9,8,7;4,5,6,5,-4;1,2,3,-2,-1};j = {2,0};N = {3,1}{2;5;8;5;-2}
x = {1,2,3+I;4,5-I,6;7,8,9};j = {0,2};N = {1}{2;5-I;8}

Copy Main Diagonal

Plan to copy the main diagonal of matrix.

Description

This plan copies the main diagonal of the matrix x from top to bottom. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{1,2,4}

Copy Superdiagonal

Plan to copy the superdiagonal of matrix.

Description

This plan copies the superdiagonal of the matrix x, that is, the diagonal just above the main diagonal, from top to bottom. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{0,6}

Copy Subdiagonal

Plan to copy the subdiagonal of matrix.

Description

This plan copies the subdiagonal of the matrix x, that is, the diagonal just below the main diagonal, from top to bottom. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{3,1,9}

Copy a Diagonal

Plan to copy a diagonal of matrix.

Description

This plan copies the k-th diagonal of the matrix x from top to bottom. Diagonals are counted from the main diagonal at k=0, with positive k values indicting diagonals above the main diagonal and negative k values indicating diagonals below it. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9};k = {2}{-1}
x = {1,0,-1;3,2,6;-1,1,4;7,8,9};k = {-2}{-1,8}

Copy Main Skew Diagonal

Plan to copy the main skew diagonal of matrix.

Description

This plan copies the main skew diagonal of the matrix x from top to bottom. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{-1,2,-1}

Copy Skew Superdiagonal

Plan to copy the skew superdiagonal of matrix.

Description

This plan copies the skew superdiagonal of the matrix x, that is, the skew diagonal just above the main skew diagonal, from top to bottom. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{0,3}

Copy Skew Subdiagonal

Plan to copy the skew subdiagonal of matrix.

Description

This plan copies the skew subdiagonal of the matrix x, that is, the skew diagonal just below the main skew diagonal, from top to bottom. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{6,1,7}

Copy a Skew Diagonal

Plan to copy a skew diagonal of matrix.

Description

This plan copies the k-th skew diagonal of the matrix x from top to bottom. Skew diagonals are counted from the main skew diagonal at k=0, with positive k values indicating skew diagonals above the main skew diagonal and negative k values indicating skew diagonals below it. The elements are copied into a column vector.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9};k = {2}{1}
x = {1,0,-1;3,2,6;-1,1,4;7,8,9};k = {-2}{4,8}

Swap Elements

Plan to swap matrix elements.

Description

This plan swaps the elements at rows i1 and columns j1 with the elements at rows i2 and columns j2 in a copy of matrix x. The element at row i1[k] and column j1[k] is swapped with the element at row i2[k] and column j2[k] for each k.

Example

x = {1,2,3;4,5,6;7,8,9};i1 = {1,2,3};j1 = {0,1,2};i2 = {0,1,2};j2 = {1,2,3}{1,4,3;2,5,8;7,6,9}

Swap Rows

Plan to swap matrix rows.

Description

This plan swaps the elements in rows i1 with the elements in rows i2 in a copy of matrix x. The elements in row i1[k] are swapped with the elements in row i2[k] for each k.

Example

x = {1,2,3;4,5,6;7,8,9};i1 = {1,2,3};i2 = {0,1,2}{4,5,6;7,8,9;1,2,3}

Swap Columns

Plan to swap matrix columns.

Description

This plan swaps the elements in columns j1 with the elements in columns j2 in a copy of matrix x. The elements in column j1[k] are swapped with the elements in column j2[k] for each k.

Example

x = {1,2,3;4,5,6;7,8,9};j1 = {1,2,3};j2 = {0,1,2}{2,3,1;5,6,4;8,9,7}

Insert Rows From Top

Plan to insert rows at indices counted from top.

Description

This plan inserts N[k] rows in a copy of matrix x, each filled with a[k]+b[k]I, just before row i[k], counted from the top, for each k. The last values in a, b, and N are used when k is out of bounds.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2,3};N = {2,1};a = {-1,-2};b = {2}{-1+2I,-1+2I,-1+2I;-1+2I,-1+2I,-1+2I;1,2,3+I;4,5-I,6;-2+2I,-2+2I,-2+2I;7,8,9;-2+2I,-2+2I,-2+2I}

Insert Rows From Bottom

Plan to insert rows at indices counted from bottom.

Description

This plan inserts N[k] rows in a copy of matrix x, each filled with a[k]+b[k]I, just before row i[k], counted from the bottom, for each k. The last values in a, b, and N are used when k is out of bounds.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2,3};N = {2,1};a = {-1,-2};b = {2}{-2+2I,-2+2I,-2+2I;1,2,3+I;-2+2I,-2+2I,-2+2I;4,5-I,6;7,8,9;-1+2I,-1+2I,-1+2I;-1+2I,-1+2I,-1+2I}

Insert Columns From Left

Plan to insert columns at indices counted from left.

Description

This plan inserts N[k] columns in a copy of matrix x, each filled with a[k]+b[k]I, just before column j[k], counted from the left, for each k. The last values in a, b, and N are used when k is out of bounds.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};j = {0,2,3};N = {2,1};a = {-1,-2};b = {2}{-1+2I,-1+2I,1,2,-2+2I,3+I,-2+2I;-1+2I,-1+2I,4,5-I,-2+2I,6,-2+2I;-1+2I,-1+2I,7,8,-2+2I,9,-2+2I}

Insert Columns From Right

Plan to insert columns at indices counted from right.

Description

This plan inserts N[k] columns in a copy of matrix x, each filled with a[k]+b[k]I, just before column j[k], counted from the right, for each k. The last values in a, b, and N are used when k is out of bounds.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};j = {0,2,3};N = {2,1};a = {-1,-2};b = {2}{-2+2I,1,-2+2I,2,3+I,-1+2I,-1+2I;-2+2I,4,-2+2I,5-I,6,-1+2I,-1+2I;-2+2I,7,-2+2I,8,9,-1+2I,-1+2I}


Rearrange Multiple Matrices

These plans produce a matrix by rearranging multiple matrices.


Conditional Copy

Plan to conditionally copy a matrix.

Description

This plan copies the matrix x if matrix z is valid and not empty; otherwise, it copies the matrix y. Note that refresh requests are not propagated to the parameters x, y, and z.

Example

x = {1,2;3,4};y = {7,6;8,9};z = {1;2}{1,2;3,4}
x = {1,2;3,4};y = {7,6;8,9};z = {}{7,6;8,9}

Stitch in Row

Plan to stitch matrices in a row (horizontally).

Description

This plan arranges copies of matrices x0, x1, etc. side by side in a row (horizontally), and fills any gaps resulting from different matrix heights with a+bI.

Example

a = {0};b = {0};x0 = {1,2,3;4,5,6};x1 = {4,5;6,7}{1,2,3,4,5;4,5,6,6,7}

Stitch in Column

Plan to stitch matrices in a column (vertically).

Description

This plan arranges copies of matrices x0, x1, etc. one below the other in a column (vertically), and fills any gaps resulting from different matrix widths with a+bI.

Example

a = {0};b = {0};x0 = {1,2,3;4,5,6};x1 = {4,5;6,7}{1,2,3;4,5,6;4,5,0;6,7,0}

Stitch in Block Matrix

Plan to stitch matrices in a block matrix.

Description

This plan arranges copies of matrices x0, x1, etc. into a block matrix and fills the gaps with a+bI. Matrix x0 is copied into the position at row i[0] and column j[0] of the block matrix, matrix x1 is copied into the position at row i[1] and column j[1], and so on.

Example

a = {0};b = {0};i = {0,1,1};j = {0,0,1};x0 = {1,2,3;4,5,6};x1 = {4,5;6,7};x2 = {2,-2;-2,2}{1,2,3,0,0;4,5,6,0,0;4,5,0,2,-2;6,7,0,-2,2}


Modify a Matrix

These plans produce a matrix by modifying another matrix.


Set Elements

Plan to set elements at indices.

Description

This plan sets, in a copy of matrix x, the element at row i[k] and column j[k] to a[k]+b[k]I for each k. The last values in a and b are used when k is out of bounds.

Example

x = {1,2,3;4,5,6;7,8,9;3,2,1};i = {3,1,0};j = {0,1,2};a = {0,-1};b = {0}{1,2,-1;4,-1,6;7,8,9;0,2,1}
x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2};j = {0,2};a = {-1,-2};b = {2}{-1+2I,2,3+I;4,5-I,6;7,8,-2+2I}

Set Rows From Top

Plan to set rows at indices counted from top.

Description

This plan sets, in a copy of matrix x, all the elements in row i[k] (counted from the top) to a[k]+b[k]I for each k. The last values in a and b are used when k is out of bounds.

Example

x = {1,2,3;4,5,6;7,8,9;3,2,1};i = {2,1};a = {0,-1};b = {0}{1,2,3;-1,-1,-1;0,0,0;3,2,1}
x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2};a = {-1,-2};b = {2}{-1+2I,-1+2I,-1+2I;4,5-I,6;-2+2I,-2+2I,-2+2I}

Set Rows From Bottom

Plan to set rows at indices counted from bottom.

Description

This plan sets, in a copy of matrix x, all the elements in row i[k] (counted from the bottom) to a[k]+b[k]I for each k. The last values in a and b are used when k is out of bounds.

Example

x = {1,2,3;4,5,6;7,8,9;3,2,1};i = {2,1};a = {0,-1};b = {0}{1,2,3;0,0,0-1,-1,-1;3,2,1}
x = {1,2,3+I;4,5-I,6;7,8,9};i = {0,2};a = {-1,-2};b = {2}{-2+2I,-2+2I,-2+2I;4,5-I,6;-1+2I,-1+2I,-1+2I}

Set Columns From Left

Plan to set columns at indices counted from left.

Description

This plan sets, in a copy of matrix x, all the elements in column j[k] (counted from the left) to a[k]+b[k]I for each k. The last values in a and b are used when k is out of bounds.

Example

x = {1,2,3;4,5,6;7,8,9;3,2,1};j = {2,1};a = {0,-1};b = {0}{1,-1,0;4,-1,0;7,-1,0;3,-1,0}
x = {1,2,3+I;4,5-I,6;7,8,9};j = {0,2};a = {-1,-2};b = {2}{-1+2I,2,-2+2I;-1+2I,5-I,-2+2I;-1+2I,8,-2+2I}

Set Columns From Right

Plan to set columns at indices counted from right.

Description

This plan sets, in a copy of matrix x, all the elements in column j[k] (counted from the right) to a[k]+b[k]I for each k. The last values in a and b are used when k is out of bounds.

Example

x = {1,2,3;4,5,6;7,8,9;3,2,1};j = {2,1};a = {0,-1};b = {0}{0,-1,3;0,-1,6;0,-1,9;0,-1,1}
x = {1,2,3+I;4,5-I,6;7,8,9};j = {0,2};a = {-1,-2};b = {2}{-2+2I,2,-1+2I;-2+2I,5-I,-1+2I;-2+2I,8,-1+2I}

Set All Elements - Cartesian Parts

Plan to set the real and imaginary parts of all elements.

Description

This plan sets all the elements in a copy of matrix x to a+bI. If a or b is not specified, the real or imaginary parts of the elements, respectively, are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};a = {};b = {0}{1,2,3;4,5,6;7,8,9}
x = {1,2,3+I;4,5-I,6;7,8,9};a = {};b = {2}{1+2I,2+2I,3+2I;4+2I,5+2I,6+2I;7+2I,8+2I,9+2I}
x = {1,2,3+I;4,5-I,6;7,8,9};a = {0};b = {}{0,0,I;0,-I,0;0,0,0}

Set All Elements - Polar Parts

Plan to set the magnitudes and phase angles of all elements.

Description

This plan sets all the elements in a copy of matrix x to r(cosφ+Isinφ). If r or φ is not specified, the magnitudes or phase angles of the elements, respectively, are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};r = {};φ = {0}{1,2,3.1623;4,5.099,6;7,8,9}
x = {1,2,3+I;4,5-I,6;7,8,9};r = {};φ = {pi/2}{I,2I,3.1623I;4I,5.099I,6I;7I,8I,9I}
x = {1,2,I;4,-I,6;7,8,9};r = {2};φ = {}{2,2,2I;2,-2I,2;2,2,2}

Set Along Rows - Cartesian Parts

Plan to assign two arrays to the real and imaginary parts of elements row by row.

Description

This plan assigns the values in the array a to the real parts and the values in the array b to the imaginary parts of the elements in a copy of matrix x along the rows. a[0] is assigned the real part of the first element, b[0] is assigned the imaginary part of the first element, a[1] is assigned the real part of the second element, and so on. Once all values in array a or b have been assigned, the real or imaginary parts of the remaining elements, respectively, are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};a = {0,0,5,7};b = {0,0,8,9,10}{0,0,5+8I;7+9I,5+10I,6;7,8,9}

Set Along Columns - Cartesian Parts

Plan to assign two arrays to the real and imaginary parts of elements column by column.

Description

This plan assigns the values in the array a to the real parts and the values in the array b to the imaginary parts of the elements in a copy of matrix x along the columns. a[0] is assigned the real part of the first element, b[0] is assigned the imaginary part of the first element, a[1] is assigned the real part of the second element, and so on. Once all values in array a or b have been assigned, the real or imaginary parts of the remaining elements, respectively, are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};a = {0,0,5,7};b = {0,0,8,9,10}{0,7+9I,3+I;0,5+10I,6;5+8I,8,9}

Set Along Rows - Polar Parts

Plan to assign two arrays to the magnitudes and phase angles of elements row by row.

Description

This plan assigns the values in the array r to the magnitudes and the values in the array φ to the phase angles of the elements in a copy of matrix x along the rows. r[0] is assigned the magnitude of the first element, φ[0] is assigned the phase angle of the first element, r[1] is assigned the magnitude of the second element, and so on. Once all values in array r or φ have been assigned, the magnitudes or phase angles of the remaining elements, respectively, are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};r = {0,0,5,7};φ = {0,0,pi/2,0,pi}{0,0,5I;7,-5.099,6;7,8,9}

Set Along Columns - Polar Parts

Plan to assign two arrays to the magnitudes and phase angles of elements column by column.

Description

This plan assigns the values in the array r to the magnitudes and the values in the array φ to the phase angles of the elements in a copy of matrix x along the columns. r[0] is assigned the magnitude of the first element, φ[0] is assigned the phase angle of the first element, r[1] is assigned the magnitude of the second element, and so on. Once all values in array r or φ have been assigned, the magnitudes or phase angles of the remaining elements, respectively, are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};r = {0,0,5,7};φ = {0,0,pi/2,0,pi}{0,7,3+I;0,-5.099,6;5I,8,9}

Set Along Rows - Cartesian Pair

Plan to assign an array to the real and imaginary parts of elements row by row.

Description

This plan assigns the values in the array y to the real and imaginary parts of the elements in a copy of matrix x along the rows. y[0] is assigned the real part of the first element, y[1] is assigned the imaginary part of the first element, y[2] is assigned the real part of the second element, and so on. Once all values in array y have been assigned, the remaining elements are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};y = {0,0,0,0,5,8,7,9,10}{0,0,5+8I;7+9I,10-I,6;7,8,9}

Set Along Columns - Cartesian Pair

Plan to assign an array to the real and imaginary parts of elements column by column.

Description

This plan assigns the values in the array y to the real and imaginary parts of the elements in a copy of matrix x along the columns. y[0] is assigned the real part of the first element, y[1] is assigned the imaginary part of the first element, y[2] is assigned the real part of the second element, and so on. Once all values in array y have been assigned, the remaining elements are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};y = {0,0,0,0,5,8,7,9,10}{0,7+9I,3+I;0,10-I,6;5+8I,8,9}

Set Along Rows - Polar Pair

Plan to assign an array to the magnitudes and phase angles of elements row by row.

Description

This plan assigns the values in the array y to the magnitudes and phase angles of the elements in a copy of matrix x along the rows. y[0] is assigned the magnitude of the first element, y[1] is assigned the phase angle of the first element, y[2] is assigned the magnitude of the second element, and so on. Once all values in array y have been assigned, the remaining elements are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};y = {0,0,0,0,5,pi,7,pi/2,10}{0,0,-5;7I,9.8058-1.9612I,6;7,8,9}

Set Along Columns - Polar Pair

Plan to assign an array to the magnitudes and phase angles of elements column by column.

Description

This plan assigns the values in the array y to the magnitudes and phase angles of the elements in a copy of matrix x along the columns. y[0] is assigned the magnitude of the first element, y[1] is assigned the phase angle of the first element, y[2] is assigned the magnitude of the second element, and so on. Once all values in array y have been assigned, the remaining elements are not modified.

Example

x = {1,2,3+I;4,5-I,6;7,8,9};y = {0,0,0,0,5,pi,7,pi/2,10}{0,7I,3+I;0,9.8058-1.9612I,6;-5,8,9}

Replace Elements

Plan to replace elements.

Description

This plan replaces, in a copy of matrix x, any elements that are equal to a1[k]+b1[k]I with a2[k]+b2[k]I for each k. The last values in a1, b1, a2, and b2 are used when k is out of bounds.

Example

x = {1,2,3;4,5,6;7,8,9};a1 = {1};b1 = {0};a2 = {-1};b2 = {0}{-1,2,3;4,5,6;7,8,9}
x = {1,2,3;4,5,6;7,8,9};a1 = {4,2,3};b1 = {0};a2 = {-1,-2};b2 = {0}{1,-2,-2;-1,5,6;7,8,9}
x = {1,2,3+I;4,5-I,6;7,8,9};a1 = {3,5,6};b1 = {1,-1,0};a2 = {-1,-2};b2 = {-3,-4}{1,2,-1-3I;4,-2-4I,-2-4I;7,8,9}

Modifying Expressions

Plan to compute elements with expressions.

Description

This plan sets the elements in an m×n matrix by evaluating the expressions in f = {f[0,0],f[0,1],...;f[1,0],...}, where f[i,j] is a function of i, j, x, x0_0, xp1_p1, xp1_n1, and so on. The output matrix is computed as f[i,j] for each row i<m and column j<n, or as the last function in f when filling column by column (column-major order). In these expressions, i is the row index and j is the column index, both starting from 0. x is the element of the matrix x at that position. Fixed references are represented as x0_0=x[0,0], x1_2=x[1,2], and so on; relative references are represented as xp1_p1=x[i-1,j-1], xn1_n1=x[i+1,j+1], and so forth. Out-of-range values are replaced with 0. If the parameters m and n are not specified, they are set to the number of rows and columns, respectively, in the matrix x.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {1,2;3,4};f = {i*x};m = {};n = {}{0,0;3,4}
x = {1,2;3,4};f = {1,2;j+i+2*x^2};m = {};n = {}{1,2;19,2}
x = {1,2;3,4};f = {1,2;j+i+2*x^2};m = {4};n = {3}{1,2,2;19,2,2;2,2,2;3,2,2}
x = {1,0,1;1,0,1;0,1,0};f = {xp1_p1+xp1_n1+xn1_p1+xn1_n1};m = {};n = {}{0,2,0;1,2,1;0,2,0}
x = {1,2,-1-3I;4,-2-4I,-2-4I;7,8,9};f = {-2*imag(x)+real(x)*I};m = {};n = {}{I,2I,6-I;4I,8-2I,8-2I;7I,8I,9I}
x = {1,2,-1-3I;4,-2-4I,-2-4I;7,8,9};f = {x,2*x,3*x;1,2,3;x,x,x};m = {};n = {}{1,4,-3-9I;1,2,3;7,8,9}

Real Part

Plan to copy the real parts of elements.

Description

This plan copies the real part of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,-2,0;3,-4,0}{1,-2,0;3,-4,0}
x = {1,2,-1-3I;4,-2-4I,-2-4I;7,8,9}{1,2,-1;4,-2,-2;7,8,9}

Imaginary Part

Plan to copy the imaginary parts of elements.

Description

This plan copies the imaginary part of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,-2,0;3,-4,0}{0,0,0;0,0,0}
x = {1,2,-1-3I;4,-2-4I,-2-4I;7,8,9}{0,0,-3;0,-4,-4;0,0,0}

Element Magnitude

Plan to compute the magnitudes of elements.

Description

This plan computes the magnitude of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,-2,0;3,-4,0}{1,2,0;3,4,0}
x = {1,2,-1-3I;4,-2-4I,-2-4I;7,8,9}{1,2,3.1623;4,4.721,4.721;7,8,9}

Element Phase Angle

Plan to compute the phase angles of elements.

Description

This plan computes the phase angle of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,-2,0;3,-4,0}{0,-3.1416,0;0,-3.1416,0}
x = {1,2,-1-3I;4,-2-4I,-2-4I;7,8,9}{0,0,-1.8925;0,-2.0344,-2.0344;0,0,0}

Element Negation

Plan to negate elements.

Description

This plan applies the negation operator "-" to x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,1.5;-3,-4}{-1,-1.5;3,4}
x = {1,2,-1-3I;4,-2-4I,-2-4I}{-1,-2,1+3I;-4,2+4I,2+4I}

Element Complex Conjugate

Plan to calculate the conjugate of each element.

Description

This plan computes the complex conjugate of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,1.5;-3,-4}{1,1.5;-3,-4}
x = {1,2,-1-3I;4,-2-4I,-2-4I}{1,2,-1+3I;4,-2+4I,-2+4I}

Element Addition

Plan to add a constant value to elements.

Description

This plan computes x[i,j]+a+bI for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0}{0,1;2,3}
x = {1,2,-1-3I;4,-2-4I,-2-4I};a = {2};b = {4}{3+4I,4+4I,1+I;6+4I,0,0}

Element Subtraction - Minuend

Plan to subtract a constant value from elements.

Description

This plan computes x[i,j]-(a+bI) for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0}{2,3;4,5}
x = {1,2,-1-3I;4,-2-4I,-2-4I};a = {2};b = {4}{-1-4I,-4I,-3-7I;2-4I,-4-8I,-4-8I}

Element Subtraction - Subtracted

Plan to subtract elements from a constant value.

Description

This plan computes a+bI-x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0}{-2,-3;-4,-5}
x = {1,2,-1-3I;4,-2-4I,-2-4I};a = {2};b = {4}{1+4I,4I,3+7I;-2+4I,4+8I,4+8I}

Element Multiplication

Plan to multiply elements by a constant value.

Description

This plan computes x[i,j]×(a+bI) for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0}{-1,-2;-3,-4}
x = {1,2,-1-3I;4,-2-4I,-2-4I};a = {2};b = {4}{2+4I,4+8I,10-10I;8+16I,12-16I,12-16I}

Element Division - Numerator

Plan to divide elements by a constant value.

Description

This plan computes x[i,j]/(a+bI) for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0}{-1,-2;-3,-4}
x = {1,2,-1-3I;4,-2-4I,-2-4I};a = {2};b = {4}{0.1-0.2I,0.2-0.4I,-0.7-0.1I;0.4-0.8I,-1,-1}

Element Division - Denominator

Plan to divide a constant value by elements.

Description

This plan computes (a+bI)/x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0}{-1,-0.5,-0.33333,-0.25}
x = {1,2,-1-3I;4,-2-4I,-2-4I};a = {2};b = {4}{2+4I,1+2I,-1.4+0.2I;0.5+I,-1,-1}

Element Square

Plan to compute the square of each element.

Description

This plan computes the square of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,4;0.25,-1}{1,16;0.0625,1}
x = {2,-1-3I;4,-2-4I}{4,-8+6I;16,-12+16I}

Element Square Root

Plan to compute the square root of each element.

Description

This plan computes the square root of x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,4;0.25,-1}{1,2;0.5,±I}
x = {2,-1-3I;4,-2-4I}{1.4142,1.0398-1.4426I;2,1.1118-1.7989I}

Element Exponentiation - Base

Plan to raise elements to the power of a constant value.

Description

This plan computes (c+dIx[i,j]a+bI for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0};c = {1};d = {0}{1,0.5;0.33333,0.25}
x = {2,-1-3I;4,-2-4I};a = {-1};b = {1};c = {2};d = {-1}{1.0887+0.25434I,-3.9723+2.4982I;0.33749+0.44565I,-3.8138+0.27864I}

Element Exponentiation - Exponent

Plan to raise a constant value to the power of each element.

Description

This plan computes (c+dI)×(a+bI)x[i,j] for each row i and column j to produce the output matrix.

Example

x = {1,2;3,4};a = {-1};b = {0};c = {1};d = {0}{-1,1;-1,1}
x = {2,-1-3I;4,-2-4I};a = {-1};b = {1};c = {2};d = {-1}{-2-4I,-1398.6+1221.7I;-8+4I,13318-3817.3I}

Element Exponential Function

Plan to compute the exponential function of each element.

Description

This plan computes the exponential function of x[i,j] as (c+dIexp((a+bIx[i,j]) for each row i and column j to produce the output matrix.

Example

x = {0,1;2,-inf};a = {1};b = {0};c = {1};d = {0}{1,2.7183;7.3891,0}
x = {2,-1-3I;4,-2-4I};a = {-1};b = {1};c = {2};d = {-1}{0.010421+0.30244I,4.2043+122.01I;-0.037805-0.015751I,31.066+901.56I}

Element Logarithm

Plan to compute the logarithm of each element.

Description

This plan computes the natural logarithm of x[i,j] as (c+dIlog(x[i,j]+a+bI) for each row i and column j to produce the output matrix.

Example

x = {0,1;2,e};a = {0};b = {0};c = {1};d = {0}{-inf,0;0.69315,1}
x = {2,-1-3I;4,-2-4I};a = {-1};b = {1};c = {2};d = {-1}{1.4785+1.2242I,-0.27675-5.7521I;2.6243-0.50779I,0.53418-6.1576I}

Element Logistic Function

Plan to compute the logistic function of each element.

Description

This plan computes the logistic function of x[i,j] as 1/(1+exp(-x[i,j])) for each row i and column j to produce the output matrix.

Example

x = {0,0.1;-1,inf}{0.5,0.52498;0.26894,1}
x = {2,-1-3I;4,-2-4I}{0.8808,-0.5624-0.12757I;0.98201,-0.083368+0.12173I}

Element Logit Function

Plan to compute the logit function of each element.

Description

This plan computes the inverse logistic (logit) function of x[i,j] as log(x[i,j] / (1-x[i,j])) for each row i and column j to produce the output matrix.

Example

x = {0,0.1;-1,0.5}{-inf,-2.1972;-0.69315±3.1416I,0}
x = {2,-1-3I;4,-2-4I}{0.69315±3.1416I,-0.13118-2.8753I;0.28768±3.1416I,-0.11157-2.9617I}

Element Sine

Plan to compute the sine of each element.

Description

This plan computes the sine of x[i,j] as (e+fIsin((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;pi,-pi/2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,0.84147;0,-1}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-0.9093-0.9093I;-0.7568-0.7568I,0}

Element Cosine

Plan to compute the cosine of each element.

Description

This plan computes the cosine of x[i,j] as (e+fIcos((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;pi,-pi/2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1,0.5403;-1,0}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{1+I,-0.41615-0.41615I;-0.65364-0.65364I,1+I}

Element Tangent

Plan to compute the tangent of each element.

Description

This plan computes the tangent of x[i,j] as (e+fItan((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;pi,-pi/2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,1.5574;0,-inf}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,2.185+2.185I;1.1578+1.1578I,0}

Element Cotangent

Plan to compute the cotangent of each element.

Description

This plan computes the cotangent of x[i,j] as (e+fIcot((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;pi,-pi/2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{inf,0.64209;-inf,0}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf+infI,0.45766+0.45766I;0.86369+0.86369I,inf+infI}

Element Secant

Plan to compute the secant of each element.

Description

This plan computes the secant of x[i,j] as (e+fIsec((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;pi,-pi/2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1,1.8508.0;-1,inf}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{1+I,-2.403-2.403I;-1.5299-1.5299I,1+I}

Element Cosecant

Plan to compute the cosecant of each element.

Description

This plan computes the cosecant of x[i,j] as (e+fIcsc((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;pi,-pi/2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{inf,1.1884;inf,-1}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf+infI,-1.0998-1.0998I;-1.3213-1.3213I,inf+infI}

Element Inverse Sine

Plan to compute the inverse sine of each element.

Description

This plan computes the inverse sine of x[i,j] as (e+fIsin-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,-1.5708;0.5236,1.5708+1.317I}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-2.8878-0.25384I;-0.49264+3.6342I,0}

Element Inverse Cosine

Plan to compute the inverse cosine of each element.

Description

This plan computes the inverse cosine of x[i,j] as (e+fIcos-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1.5708,3.1416;1.0472,-1.317I}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{1.5708+1.5708I,4.4586+1.8246I;2.0634-2.0634I,1.5708+1.5708I}

Element Inverse Tangent

Plan to compute the inverse tangent of each element.

Description

This plan computes the inverse tangent of x[i,j] as (e+fItan-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,-0.7854;0.46365,1.1071}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-1.1071-1.1071I;1.3258+1.3258I,0}

Element Inverse Cotangent

Plan to compute the inverse cotangent of each element.

Description

This plan computes the inverse cotangent of x[i,j] as (e+fIcot-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1.5708,-0.7854;1.1071,0.46365}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{1.5708+1.5708I,-0.46365-0.46365I;0.24498+0.24498I,1.5708+1.5708I}

Element Inverse Secant

Plan to compute the inverse secant of each element.

Description

This plan computes the inverse secant of x[i,j] as (e+fIsec-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{nan,3.1416;-1.317I,1.0472}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{-inf+infI,2.0944+2.0944I;1.3181+1.3181I,-inf+infI}

Element Inverse Cosecant

Plan to compute the inverse cosecant of each element.

Description

This plan computes the inverse cosecant of x[i,j] as (e+fIcsc-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{nan,-1.5708;1.5708+1.317I,0.5236}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf-infI,-0.5236-0.5236I;0.25268+0.25268I,inf-infI}

Element Hyperbolic Sine

Plan to compute the hyperbolic sine of each element.

Description

This plan computes the hyperbolic sine of x[i,j] as (e+fIsinh((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;-1,log(2)};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,1.1752;-1.1752,0.75}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-3.6269-3.6269I;27.29+27.29I,0}

Element Hyperbolic Cosine

Plan to compute the hyperbolic cosine of each element.

Description

This plan computes the hyperbolic cosine of x[i,j] as (e+fIcosh((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;-1,log(2)};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1,1.5431;1.5431,1.25}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{1+I,3.7622+3.7622I;27.308+27.308I,1+I}

Element Hyperbolic Tangent

Plan to compute the hyperbolic tangent of each element.

Description

This plan computes the hyperbolic tangent of x[i,j] as (e+fItanh((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;-1,log(2)};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,0.76159;-0.76159,0.6}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-0.96403-0.96403I;0.99933+0.99933I,0}

Element Hyperbolic Cotangent

Plan to compute the hyperbolic cotangent of each element.

Description

This plan computes the hyperbolic cotangent of x[i,j] as (e+fIcoth((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;-1,log(2)};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{inf,1.313;-1.313,1.6667}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf+infI,-1.0373-1.0373I;1.0007+1.0007I,inf+infI}

Element Hyperbolic Secant

Plan to compute the hyperbolic secant of each element.

Description

This plan computes the hyperbolic secant of x[i,j] as (e+fIsech((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;-1,log(2)};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1,0.64805;0.64805,0.8}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{1+I,0.2658+0.2658I;0.036619+0.036619I,1+I}

Element Hyperbolic Cosecant

Plan to compute the hyperbolic cosecant of each element.

Description

This plan computes the hyperbolic cosecant of x[i,j] as (e+fIcsch((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1;-1,log(2)};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{inf,0.85092;-0.85092,1.3333}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf+infI,-0.27572-0.27572I;0.036644+0.036644I,inf+infI}

Element Inverse Hyperbolic Sine

Plan to compute the inverse hyperbolic sine of each element.

Description

This plan computes the inverse hyperbolic sine of x[i,j] as (e+fIsinh-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1,-1;0.5,2,0};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,0.88137,-0.88137;0.48121,1.4436,0}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-1.4436-1.4436I;2.0947+2.0947I,0}

Element Inverse Hyperbolic Cosine

Plan to compute the inverse hyperbolic cosine of each element.

Description

This plan computes the inverse hyperbolic cosine of x[i,j] as (e+fIcosh-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1,-1;0.5,2,0};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{1.5708I,0,3.1416I;±1.0472I,1.317,1.5708I}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{-1.5708+1.5708I,-1.8246+4.4586I;2.0634+2.0634I,-1.5708+1.5708I}

Element Inverse Hyperbolic Tangent

Plan to compute the inverse hyperbolic tangent of each element.

Description

This plan computes the inverse hyperbolic tangent of x[i,j] as (e+fItanh-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1,-1;0.5,2,0};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{0,inf,-inf;0.54931,0.54931+1.5708I,0}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{0,-2.1201+1.0215I;-1.3154+1.8262I,0}

Element Inverse Hyperbolic Cotangent

Plan to compute the inverse hyperbolic cotangent of each element.

Description

This plan computes the inverse hyperbolic cotangent of x[i,j] as (e+fIcoth-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1,-1;0.5,2,0};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{nan,inf,-inf;0.54931+1.5708I,0.54931,nan}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{nan,-0.54931-0.54931I;0.25541+0.25541I,nan}

Element Inverse Hyperbolic Secant

Plan to compute the inverse hyperbolic secant of each element.

Description

This plan computes the inverse hyperbolic secant of x[i,j] as (e+fIsech-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1,-1;0.5,2,0};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{inf,0,±3.1416I;1.317,±1.0472I,inf}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf+infI,±2.0944(1-I);±1.3181(1-I),inf+infI}

Element Inverse Hyperbolic Cosecant

Plan to compute the inverse hyperbolic cosecant of each element.

Description

This plan computes the inverse hyperbolic cosecant of x[i,j] as (e+fIcsch-1((a+bIx[i,j]+c+dI) for each row i and column j to produce the output matrix.

Example

x = {0,1,-1;0.5,2,0};a = {1};b = {0};c = {0};d = {0};e = {1};f = {0}{inf,0.88137,-0.88137;1.4436,0.48121,inf}
x = {2,1-I;4+2I,2};a = {1};b = {-1};c = {-2};d = {2};e = {1};f = {1}{inf+infI,-0.48121-0.48121I;0.24747+0.24747I,inf+infI}

Element Sinc Function

Plan to compute the normalized sinc function of each element.

Description

This plan computes the normalized sinc function of x[i,j] as sin(πx[i,j]) / (πx[i,j]), with sinc(0)=1, for each row i and column j to produce the output matrix.

Example

x = {0,-1;0.5,2}{1,0;0.63662,0}
x = {2,1-I;4+2I,2}{0,-1.838+1.838I;8.5226+17.045I,0}

Sum in Rows

Plan to compute the sum of elements in each row.

Description

This plan computes the sum of the elements in each row of the matrix x to produce the output matrix. The output is a column vector.

Example

x = {0,1,-1;0.5,2,0}{0;2.5}
x = {2,1-I;4+2I,2}{3-I;6+2I}

Sum in Columns

Plan to compute the sum of elements in each column.

Description

This plan computes the sum of the elements in each column of the matrix x to produce the output matrix. The output is a row vector.

Example

x = {0,1,-1;0.5,2,0}{0.5,3,-1}
x = {2,1-I;4+2I,2}{6+2I,3-I}

Product in Rows

Plan to compute the product of elements in each row.

Description

This plan computes the product of the elements in each row of the matrix x to produce the output matrix. The output is a column vector.

Example

x = {0,1,-1;0.5,2,0}{0;0}
x = {2,1-I;4+2I,2}{2-2I;8+4I}

Product in Columns

Plan to compute the product of elements in each column.

Description

This plan computes the product of the elements in each column of the matrix x to produce the output matrix. The output is a row vector.

Example

x = {0,1,-1;0.5,2,0}{0,2,0}
x = {2,1-I;4+2I,2}{8+4I,2-2I}

Sum of Powers in Rows

Plan to compute the sum of powers of elements in each row.

Description

This plan computes the sum of the powers of the elements in each row of the matrix x, defined as Sumj(x[i,j]p), to produce the output matrix. The output is a column vector.

Example

x = {0,1,-1;0.5,2,0};p = {2}{2;4.25}
x = {2,1-I;4+2I,2};p = {-1}{1+0.5I;0.7-0.1I}

Sum of Powers in Columns

Plan to compute the sum of powers of elements in each column.

Description

This plan computes the sum of the powers of the elements in each column of the matrix x, defined as Sumi(x[i,j]p), to produce the output matrix. The output is a row vector.

Example

x = {0,1,-1;0.5,2,0};p = {2}{0.25,5,1}
x = {2,1-I;4+2I,2};p = {-1}{0.7-0.1I,1+0.5I}

Norm in Rows

Plan to compute the p-norm of elements in each row.

Description

This plan computes the p-norm of the elements in each row of the matrix x to produce the output matrix. The norm parameter p can be real number ≥1 or inf. The output is a column vector.

Example

x = {0,1,-1;0.5,2,0};p = {inf}{1;2}
x = {2,1-I;4+2I,2};p = {1}{3.4142;6.4721}

Norm in Columns

Plan to compute the p-norm of elements in each column.

Description

This plan computes the p-norm of the elements in each column of the matrix x to produce the output matrix. The norm parameter p can be real number ≥1 or inf. The output is a row vector.

Example

x = {0,1,-1;0.5,2,0};p = {inf}{0.5,2,1}
x = {2,1-I;4+2I,2};p = {1}{6.4721,3.4142}

Fast Fourier Transform

Plan to compute the fast Fourier transform of columns.

Description

This plan applies the fast Fourier transform to each column vector in matrix x to produce the output matrix. The transform is fastest when the transform length, that is, the number of matrix rows, is a power of 2.

Example

x = {0,1,-1;0.5,2,0}{0.5,3,-1;-0.5,-1,-1}
x = {2,1-I;4+2I,2}{6+2I,3-I;-2-2I,-1-I}

Inverse Fast Fourier Transform

Plan to compute the inverse fast Fourier transform of columns.

Description

This plan applies the inverse fast Fourier transform to each column vector in matrix x to produce the output matrix.

Example

x = {0.5,3,-1;-0.5,-1,-1}{0,1,-1;0.5,2,0}
x = {6+2I,3-I;-2-2I,-1-I}{2,1-I;4+2I,2}

2D Fast Fourier Transform

Plan to compute the 2D fast Fourier transform of matrix.

Description

This plan computes the 2D fast Fourier transform of the matrix x. The transform is fastest when the transform lengths, that is, the number of matrix rows and columns, are powers of 2.

Example

x = {0,1,-1;0.5,2,0}{2.5,-0.5-3.4641I,-0.5+3.4641I;-2.5,0.5,0.5}
x = {2,1-I;4+2I,2}{9+I,3+3I;-3-3I,-1-I}

2D Inverse Fast Fourier Transform

Plan to compute the 2D inverse fast Fourier transform of matrix.

Description

This plan computes the 2D inverse fast Fourier transform of the matrix x.

Example

x = {2.5,-0.5-3.4641I,-0.5+3.4641I;-2.5,0.5,0.5}{0,1,-1;0.5,2,0}
x = {9+I,3+3I;-3-3I,-1-I}{2,1-I;4+2I,2}

Translate - Nearest Neighbor

Plan to translate a matrix using nearest-neighbor interpolation.

Description

This plan translates the matrix x by δi positions along the columns and δj positions along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};δi = {1};δj = {1};a = {0};b = {0}{0,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I}
x = {1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1};δi = {0.5};δj = {0.5};a = {1};b = {0}{1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1}

Translate - Bilinear

Plan to translate a matrix using bilinear interpolation.

Description

This plan translates the matrix x by δi positions along the columns and δj positions along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};δi = {1};δj = {1};a = {0};b = {0}{0,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I}
x = {1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1};δi = {0.5};δj = {0.5};a = {1};b = {0}{1,0.75,0.5,0.5;0.75,0.5,0.25,0;0.5,0.25,0.5,0.25;0.5,0,0.25,0.5}

Translate - Bicubic

Plan to translate a matrix using bicubic spline interpolation.

Description

This plan translates the matrix x by δi positions along the columns and δj positions along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};δi = {1};δj = {1};a = {0};b = {0}{0,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I}
x = {1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1};δi = {0.5};δj = {0.5};a = {1};b = {0}{1,0.75,0.5,0.5;0.75,0.5,0.25,0;0.5,0.25,0.64063,0.25;0.5,0,0.25,0.5}

Scale - Nearest Neighbor

Plan to scale a matrix using nearest-neighbor interpolation.

Description

This plan scales the matrix x about its center by the specified scale factors: si along the columns and sj along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};si = {0.5};sj = {0.5};a = {0};b = {-1}{-I,-I,-I,-I;-I,I,0,-I;-I,0,I,-I;-I,-I,-I,-I}
x = {1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1};si = {2};sj = {2};a = {0};b = {0}{1,1,0,0;1,1,0,0;0,0,1,1;0,0,1,1}
x = {1,2,3,0;4,5,6,0;0,7,8,9};si = {-1};sj = {1};a = {0};b = {0}{0,7,8,9;4,5,6,0;1,2,3,0}

Scale - Bilinear

Plan to scale a matrix using bilinear interpolation.

Description

This plan scales the matrix x about its center by the specified scale factors: si along the columns and sj along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};si = {0.5};sj = {0.5};a = {0};b = {-1}{-I,-I,-I,-I;-I,I,0,-I;-I,0,I,-I;-I,-I,-I,-I}
x = {1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1};si = {2};sj = {2};a = {0};b = {0}{0.7551,0.61224,0.2449,0;0.61224,0.59184,0.40816,0.2449;0.2449,0.40816,0.59184,0.61224;0,0.2449,0.61224,0.7551}
x = {1,2,3,0;4,5,6,0;0,7,8,9};si = {-1};sj = {1};a = {0};b = {0}{0,7,8,9;4,5,6,0;1,2,3,0}

Scale - Bicubic

Plan to scale a matrix using bicubic spline interpolation.

Description

This plan scales the matrix x about its center by the specified scale factors: si along the columns and sj along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};si = {0.5};sj = {0.5};a = {0};b = {-1}{-I,-I,-I,-I;-I,I,0,-I;-I,0,I,-I;-I,-I,-I,-I}
x = {1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1};si = {2};sj = {2};a = {0};b = {0}{0.7551,0.61224,0.2449,0;0.61224,0.77008,0.45483,0.2449;0.2449,0.45483,0.77008,0.61224;0,0.2449,0.61224,0.7551}
x = {1,2,3,0;4,5,6,0;0,7,8,9};si = {-1};sj = {1};a = {0};b = {0}{0,7,8,9;4,5,6,0;1,2,3,0}

Rotate - Nearest Neighbor

Plan to rotate a matrix using nearest-neighbor interpolation.

Description

This plan rotates the matrix x about its center by the specified angle (in radians), without changing the matrix dimensions, to produce the output matrix. A positive angle is measured counterclockwise. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {2I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};angle = {pi/2};a = {0};b = {0}{0,0,0,I;0,0,I,0;0,I,0,0;2I,0,0,0}
x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};angle = {pi/4}a = {0};b = {0}{1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1}

Rotate - Bilinear

Plan to rotate a matrix using bilinear interpolation.

Description

This plan rotates the matrix x about its center by the specified angle (in radians), without changing the matrix dimensions, to produce the output matrix. A positive angle is measured counterclockwise. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {2I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};angle = {pi/2};a = {0};b = {0}{0,0,0,I;0,0,I,0;0,I,0,0;2I,0,0,0}
x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};angle = {pi/4}a = {0};b = {0}{0.52513,0.43934,0,0;1,1,0.43934,0;0.43934,1,1,0.43934;0,0.43934,1,1;0,0,0.43934,0.52513}

Rotate - Bicubic

Plan to rotate a matrix using bicubic spline interpolation.

Description

This plan rotates the matrix x about its center by the specified angle (in radians), without changing the matrix dimensions, to produce the output matrix. A positive angle is measured counterclockwise. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {2I,0,0,0;0,I,0,0;0,0,I,0;0,0,0,I};angle = {pi/2};a = {0};b = {0}{0,0,0,I;0,0,I,0;0,I,0,0;2I,0,0,0}
x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};angle = {pi/4}a = {0};b = {0}{0.52513,0.43934,0,0;1,1,0.43934,0;0.43934,1.0625,1.0625,0.43934;0,0.43934,1,1;0,0,0.43934,0.52513}

Shear - Nearest Neighbor

Plan to shear a matrix using nearest-neighbor interpolation.

Description

This plan shears the matrix x about its center by the specified shear factors: si along the columns and sj along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};si = {0.5};sj = {0.5};a = {0};b = {0}{1,1,0,0;0,1,0,0;0,1,1,0;0,0,1,0}

Shear - Bilinear

Plan to shear a matrix using bilinear interpolation.

Description

This plan shears the matrix x about its center by the specified shear factors: si along the columns and sj along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};si = {0.5};sj = {0.5};a = {0};b = {0}{0.5,0.83333,0,0;0,1,0.5,0;0,0.5,1,0;0,0,0.83333,0.5}

Shear - Bicubic

Plan to shear a matrix using bicubic spline interpolation.

Description

This plan shears the matrix x about its center by the specified shear factors: si along the columns and sj along the rows, without changing the matrix dimensions, to produce the output matrix. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};si = {0.5};sj = {0.5};a = {0};b = {0}{0.5,0.83333,0,0;0,1.0694,0.5,0;0,0.5,1.0694,0;0,0,0.83333,0.5}

Transform - Nearest Neighbor

Plan to transform a matrix using nearest-neighbor interpolation.

Description

This plan transforms the matrix x about its center using the specified transformation array t, without changing the matrix dimensions, to produce the output matrix. t[0] and t[1] specify scaling along the columns and rows, t[2] and t[3] specify shearing along the columns and rows, and t[4] and t[5] specify translations along the columns and rows. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};t = {1,1,0.5,0.5,0.5,0.5};a = {0};b = {0}{0,1,0,0;0,1,1,0;0,0,1,0;0,0,1,1}

Transform - Bilinear

Plan to transform a matrix using bilinear interpolation.

Description

This plan transforms the matrix x about its center using the specified transformation array t, without changing the matrix dimensions, to produce the output matrix. t[0] and t[1] specify scaling along the columns and rows, t[2] and t[3] specify shearing along the columns and rows, and t[4] and t[5] specify translations along the columns and rows. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};t = {1,1,0.5,0.5,0.5,0.5};a = {0};b = {0}{0.16667,0.5,0,0;0,0.83333,0.83333,0;0,0.16667,1,0.16667;0,0,0.83333,0.83333}

Transform - Bicubic

Plan to transform a matrix using bicubic spline interpolation.

Description

This plan transforms the matrix x about its center using the specified transformation array t, without changing the matrix dimensions, to produce the output matrix. t[0] and t[1] specify scaling along the columns and rows, t[2] and t[3] specify shearing along the columns and rows, and t[4] and t[5] specify translations along the columns and rows. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};t = {1,1,0.5,0.5,0.5,0.5};a = {0};b = {0}{0.16667,0.5,0,0;0,0.83333,0.83333,0;0,0.16667,1.125,0.16667;0,0,0.83333,0.83333}

Resize with Fixed Aspect Ratio - Nearest Neighbor

Plan to resize a matrix with fixed aspect ratio using nearest-neighbor interpolation.

Description

This plan stretches or shrinks the matrix x to m×n to produce the output matrix. When a dimension is not specified, the aspect ratio is preserved. New elements are calculated using nearest-neighbor interpolation.

Example

x = {0,I,I,0;0,I,I,0;0,I,I,0;0,I,I,0};m = {3};n = {}{0,I,0;0,I,0;0,I,0}
x = {1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1};m = {};n = {3}{1,0,0;0,1,0;0,0,1}

Resize with Fixed Aspect Ratio - Bilinear

Plan to resize a matrix with fixed aspect ratio using bilinear interpolation.

Description

This plan stretches or shrinks the matrix x to m×n to produce the output matrix. When a dimension is not specified, the aspect ratio is preserved. New elements are calculated using bilinear interpolation.

Example

x = {0,I,I,0;0,I,I,0;0,I,I,0;0,I,I,0};m = {3};n = {}{0,I,0;0,I,0;0,I,0}
x = {1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1};m = {};n = {3}{1,0,0;0,1,0;0,0,1}

Resize with Fixed Aspect Ratio - Bicubic

Plan to resize a matrix with fixed aspect ratio using bicubic spline interpolation.

Description

This plan stretches or shrinks the matrix x to m×n to produce the output matrix. When a dimension is not specified, the aspect ratio is preserved. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {0,I,I,0;0,I,I,0;0,I,I,0;0,I,I,0};m = {3};n = {}{0,I,0;0,1.125I,0;0,I,0}
x = {1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1};m = {};n = {3}{1,0,0;0,1.125,0;0,0,1}

Resize and Stretch - Nearest Neighbor

Plan to resize and stretch a matrix using nearest-neighbor interpolation.

Description

This plan stretches or shrinks the matrix x to m×n to produce the output matrix. When a dimension is not specified, it is preserved. New elements are calculated using nearest-neighbor interpolation.

Example

x = {0,I,I,0;0,I,I,0;0,I,I,0;0,I,I,0};m = {3};n = {}{0,I,I,0;0,I,I,0;0,I,I,0}
x = {1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1};m = {};n = {3}{1,0,0;1,0,0;0,1,0;0,1,1;0,0,1}

Resize and Stretch - Bilinear

Plan to resize and stretch a matrix using bilinear interpolation.

Description

This plan stretches or shrinks the matrix x to m×n to produce the output matrix. When a dimension is not specified, it is preserved. New elements are calculated using bilinear interpolation.

Example

x = {0,I,I,0;0,I,I,0;0,I,I,0;0,I,I,0};m = {3};n = {}{0,I,I,0;0,I,I,0;0,I,I,0}
x = {1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1};m = {};n = {3}{1,0,0;1,0.5,0;0,1,0;0,0.5,1;0,0,1}

Resize and Stretch - Bicubic

Plan to resize and stretch a matrix using bicubic spline interpolation.

Description

This plan stretches or shrinks the matrix x to m×n to produce the output matrix. When a dimension is not specified, it is preserved. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {0,I,I,0;0,I,I,0;0,I,I,0;0,I,I,0};m = {3};n = {}{0,I,I,0;0,I,I,0;0,I,I,0}
x = {1,0,0,0;1,1,0,0;0,1,1,0;0,0,1,1;0,0,0,1};m = {};n = {3}{1,0,0;1,0.5,0;0,1.125,0;0,0.5,1;0,0,1}

Interpolate Patch - Nearest Neighbor

Plan to apply a nearest-neighbor interpolation to patch of coordinates.

Description

This plan interpolates the specified patch of coordinates (i, j) in the matrix x. The output matrix has a number of rows equal to the length of i and a number of columns equal to the length of j. The element in row r and column s of the output matrix is the interpolation of the coordinates (i[r], j[s]) in the matrix x. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {0,I,I,0;0,1+I,1+I,0;0,1+I,1+I,0;0,I,I,0};i = {-0.5,0.5,1.5};j = {0.5,1.5};a = {0};b = {0}{I,I;1+I,1+I;1+I,1+I}

Interpolate Patch - Bilinear

Plan to apply a bilinear interpolation to patch of coordinates.

Description

This plan interpolates the specified patch of coordinates (i, j) in the matrix x. The output matrix has a number of rows equal to the length of i and a number of columns equal to the length of j. The element in row r and column s of the output matrix is the interpolation of the coordinates (i[r], j[s]) in the matrix x. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {0,I,I,0;0,1+I,1+I,0;0,1+I,1+I,0;0,I,I,0};i = {-0.5,0.5,1.5};j = {0.5,1.5};a = {0};b = {0}{0.25I,0.5I;0.25+0.5I,0.5+I;0.5+0.5I,1+I}

Interpolate Patch - Bicubic

Plan to apply a bicubic spline interpolation to patch of coordinates.

Description

This plan interpolates the specified patch of coordinates (i, j) in the matrix x. The output matrix has a number of rows equal to the length of i and a number of columns equal to the length of j. The element in row r and column s of the output matrix is the interpolation of the coordinates (i[r], j[s]) in the matrix x. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {0,I,I,0;0,1+I,1+I,0;0,1+I,1+I,0;0,I,I,0};i = {-0.5,0.5,1.5};j = {0.5,1.5};a = {0};b = {0}{0.25I,0.5I;0.25+0.5I,0.5+I;0.5+0.5I,1.2656+1.125I}

Interpolate List - Nearest Neighbor

Plan to apply a nearest-neighbor interpolation to list of coordinates.

Description

This plan interpolates the specified list of coordinates (i, j) in the matrix x. The output is a column vector whose number of rows equals the length of the larger array between i and j. The k-th element of the output is the interpolation of the coordinates (i[k], j[k]) in the matrix x. If k exceeds the length of i or j, the last value in i or j is used, respectively. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using nearest-neighbor interpolation.

Example

x = {0,I,I,0;0,1+I,1+I,0;0,1+I,1+I,0;0,I,I,0};i = {-0.5,0.5,1.5};j = {0.5,1.5};a = {0};b = {0}{I;1+I;1+I}

Interpolate List - Bilinear

Plan to apply a bilinear interpolation interpolation to list of coordinates.

Description

This plan interpolates the specified list of coordinates (i, j) in the matrix x. The output is a column vector whose number of rows equals the length of the larger array between i and j. The k-th element of the output is the interpolation of the coordinates (i[k], j[k]) in the matrix x. If k exceeds the length of i or j, the last value in i or j is used, respectively. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bilinear interpolation.

Example

x = {0,I,I,0;0,1+I,1+I,0;0,1+I,1+I,0;0,I,I,0};i = {-0.5,0.5,1.5};j = {0.5,1.5};a = {0};b = {0}{0.25I;0.5+I;1+I}

Interpolate List - Bicubic

Plan to apply a bicubic spline interpolation to list of coordinates.

Description

This plan interpolates the specified list of coordinates (i, j) in the matrix x. The output is a column vector whose number of rows equals the length of the larger array between i and j. The k-th element of the output is the interpolation of the coordinates (i[k], j[k]) in the matrix x. If k exceeds the length of i or j, the last value in i or j is used, respectively. For out-of-range elements during interpolation, a+bI is used. New elements are calculated using bicubic spline interpolation, while bilinear interpolation is applied to coordinates adjacent to the matrix edges.

Example

x = {0,I,I,0;0,1+I,1+I,0;0,1+I,1+I,0;0,I,I,0};i = {-0.5,0.5,1.5};j = {0.5,1.5};a = {0};b = {0}{0.25I;0.5+I;1.2656+1.125I}

Conjugate Transpose

Plan to conjugate transpose a matrix.

Description

This plan computes the conjugate transpose of the matrix x. This operation swaps x[i,j] with x[j,i]*, that is, the conjugate of x[j,i], for each row i and column j, to produce the output matrix.

Example

x = {1+I,2,3+2I;4,5-I,6}{1-I,4;2,5+I;3-2I,6}

Normalize Rows

Plan to normalize rows to unit p-norm.

Description

This plan normalizes the rows in the matrix x to unit p-norm by dividing x[i,j] by the p-norm of the i-th row, for each row i and column j, to produce the output matrix. The norm parameter p can be any positive integer.

Example

x = {1,1+I,0;0,-2,I;0,4,1+2I};p = {2}{0.57735,0.57735+0.57735I,0;0,-0.89443,0.44721I;0,0.87287,0.21822+0.43644I}
x = {1,0,4;1,1,6;-3,0,-10};p = {1}{0.2,0,0.8;0.125,0.125,0.75;-0.23077,0,-0.76923}

Normalize Columns

Plan to normalize columns to unit p-norm.

Description

This plan normalizes the columns in the matrix x to unit p-norm by dividing x[i,j] by the p-norm of the j-th column, for each row i and column j, to produce the output matrix. The norm parameter p can be any positive integer.

Example

x = {1,1+I,0;0,-2,I;0,4,1+2I};p = {2}{1,0.2132+0.2132I,0;0,-0.4264,0.40825I;0,0.8528,0.40825+0.8165I}
x = {1,0,4;1,1,6;-3,0,-10};p = {1}{0.2,0,0.2;0.2,1,0.3;-0.6,0,-0.5}

Matrix Inverse

Plan to invert a matrix.

Description

This plan inverts the square matrix x to produce the output matrix.

Example

x = {1,0,0;0,-I,0;0,0,I}{1,0,0;0,I,0;0,0,-I}
x = {1,0,4;1,1,6;-3,0,-10}{-5,0,-2;-4,1,-1;1.5,0,0.5}

Matrix Exponentiation

Plan to compute the power of matrix.

Description

This plan computes the k-th power of the square matrix x, where k is an integer.

Example

x = {1,1,1;0,1,1;0,0,1};k = {3}{1,3,6;0,1,3;0,0,1}
x = {1,0,4;1,1,6;-3,0,-10};k = {-1}{-5,0,-2;-4,1,-1;1.5,0,0.5}

Matrix Polynomial

Plan to compute the polynomial expression of matrix.

Description

This plan computes the polynomial expression of the square matrix x, defined as

(a[0]+b[0]I)I+(a[1]+b[1]I)x+(a[2]+b[2]I)x2+....

Here, I is the identity matrix. If the indices exceed the length of a or b, their last values are used.

Example

x = {1,1,1;0,1,1;0,0,1};a = {-2,1,1};b = {1}{3I,3+3I,4+4I;0,3I,3+3I;0,0,3I}
x = {1,0,4;1,1,6;-3,0,-10};a = {0,0,1};b = {0}{-11,0,-36;-16,1,-50;27,0,88}

Matrix Square Root

Plan to compute the square root of matrix.

Description

This plan computes the square root of the square matrix x.

Example

x = {1,1,1;0,1,1;0,0,1}{1,0.5,0.375;0,1,0.5;0,0,1}

Matrix Exponential Function

Plan to compute the exponential function of matrix.

Description

This plan computes the exponential function of the square matrix x.

Example

x = {1,1,1;0,1,1;0,0,1}{2.7183,2.7183,4.0774;0,2.7183,2.7183;0,0,2.7183}

Matrix Logarithm

Plan to compute the logarithm of matrix.

Description

This plan computes the logarithm of the square matrix x.

Example

x = {e,e,1.5*e;0,e,e;0,0,e}{1,1,1;0,1,1;0,0,1}

Trace

Plan to compute the trace of matrix.

Description

This plan computes the trace of the matrix x. To account for complex-valued results, the output is presented as a 1×1 matrix.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{7}

Determinant

Plan to compute the determinant of matrix.

Description

This plan computes the determinant of the square matrix x. To account for complex-valued results, the output is presented as a 1×1 matrix.

Example

x = {1,0,-1;3,2,6;-1,1,4}{-3}

Eigen Decomposition

Plan to apply an eigen decomposition.

Description

This plan computes the eigen decomposition of the square matrix x. The output is a matrix in the form [d,P], where d is a column vector containing the eigenvalues and P is a matrix containing the corresponding normalized eigenvectors, such that x = P×Diag(d)×P-1.

Example

x = {2,0,0;0,3,4;0,4,9}{11,0,0,1;1,0.44721,0.89443,0;2,0.89443,-0.44721,0}

Cholesky Decomposition

Plan to apply a Cholesky decomposition.

Description

This plan computes the Cholesky decomposition of the positive-definite matrix x. The output matrix U is an upper triangular matrix such that x = U*×U.

Example

x = {2,0,0;0,3,4;0,4,9}{1.4142,0,0;0,1.7321,2.3094;0,0,1.9149}

Lower-Upper Decomposition

Plan to apply a lower-upper decomposition.

Description

This plan computes the lower-upper decomposition of the square matrix x. The output is a matrix in the form [L,U,P], where L is a lower-triangular matrix, U is an upper-triangular matrix, and P is a permutation matrix such that x = P*×L×U.

Example

x = {2,0,0;0,3,4;0,4,9}{1,0,0,2,0,0,1,0,0;0,1,0,0,4,9,0,0,1;0,0.75,1,0,0,-2.75,0,1,0}

Singular Value Decomposition

Plan to apply a singular value decomposition.

Description

This plan computes the singular value decomposition of the matrix x. The output is a matrix in the form [s,U,V], where s is a column vector containing the singular values in descending order, and U and V are unitary matrices such that x = U×Diag(s)×V*. If x is not square, s, U, or V may be padded with zeros to fill the output block matrix.

Example

x = {2,0,0;0,3,4;0,4,9}{11,0,1,0,0,1,0;2,-0.44721,0,-0.89443,-0.44721,0,-0.89443;1,-0.89443,0,0.44721,-0.89443,0,0.44721}


Modify Multiple Matrices

These plans produce a matrix by modifying multiple matrices.


Conditionally Replace Elements

Plan to replace when corresponding elements match given values.

Description

This plan replaces, in a copy of matrix source, any elements whose corresponding reference element is equal to a1[k]+b1[k]I with a2[k]+b2[k]I for each k. The last values in a1, b1, a2, and b2 are used when k is out of bounds. The reference element for source[i,j] is defined as the element at row i and column j in the specified reference matrix.

Example

source = {6,5,4;3,2,1;8,7,9};reference = {1,2,3;4,5,6;1,1,2};a1 = {1};b1 = {0};a2 = {-1};b2 = {0}{-1,5,4;3,2,1;-1,-1,9}
source = {6,5,4;3,2,1;8,7,9};reference = {1,2,3;4,5,6;1,1,2};a1 = {4,2,3};b1 = {0};a2 = {-1,-2};b2 = {0}{6,-2,-2;-1,2,1;8,7,-2}

Linear Element Expression

Plan to compute the linear combinations of elements across matrices.

Description

This plan linearly combines elements across multiple matrices, defined as

a[0]+b[0]I+(a[1]+b[1]Ix0[i,j]+(a[2]+b[2]Ix1[i,j]+...,

for each row i and column j, to produce the output matrix. The output matrix is as large as the largest xk matrix. Out-of-range elements in these matrices are replaced with zero.

Example

a = {1,-1,1,-1};b = {0};x0 = {1,0;-1,2};x1 = {0,0;-1,7};x2 = {5,3;-7,-2}{-5,-2;8,8}

Simple Expression Across Matrices

Plan to compute elements with an expression of elements across matrices.

Description

This plan evaluates the expression f(i,j,x0,x1,...) for each row i and column j to produce the elements of the output matrix. In this expression, i and j are the row and column indices, both starting from 0. x0 is the element of the matrix x0 at row i and column j, x1 is the element of the matrix x1 at the same position, and so on. This plan can process up to 20 matrices, using an expression of the elements at the same position across matrices. The output matrix is as large as the largest xk matrix. Out-of-range elements are replaced with 0.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

f = {1+i+x0-2*x1+x2*(x3^2)};x0 = {1,-1;1,-1};x1 = {1,2;3,0};x2 = {-1,-2;-3,0};x3 = {0,2}{0,-12;-3,1}
f = {i-j};x0 = {0,0;0,0}{0,-1;1,0}

Expressions Across Matrices

Plan to compute elements with expressions of elements across matrices.

Description

This plan evaluates the expressions in f = {f[0,0],f[0,1],...;f[1,0],...} to produce the elements of the output matrix. Here, f[i,j] is a function of i, j, x, y, z, u, v, w, x0_0, xp1_p1, xp1_n1, ..., y0_0, yp1_p1, and so on. The output matrix is computed as f[i,j] for each row i and column j, or as the last function in f when filling column by column (column-major order). In these expressions, i and j are the row and column indices, both starting from 0. x, y, z, u, v, and w are the elements of the matrices x, y, z, u, v, and w, respectively, at the same position across the matrices. Fixed references are represented as x0_0=x[0,0], x1_2=x[1,2], and so on; relative references are represented as xp1_p1=x[i-1,j-1], xn1_n1=x[i+1,j+1], and so forth. The output matrix is as large as the largest xk matrix. Out-of-range elements are replaced with 0.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

f = {i+x-y};x = {1,2;3,4};y = {1,-1;1,0}{0,3;3,5}
f = {x1_0+y1_0;x0_1-x-y0_1};x = {1,2;3,4};y = {1,-1;1,0}{4,1;0,-1}
f = {2*x-xp1_p1-xn1_p1+yn1_p0*yp0_n1};x = {1,2;3,4};y = {1,1;6,7}{8,1;6,7}

Element Product - Hadamard

Plan to compute the element-wise (Hadamard) product of matrices.

Description

This plan computes the element-wise (Hadamard) product of the matrices x0, x1, and so on. When the matrix dimensions differ, the identity value is used for out-of-range elements.

Example

x0 = {1,0;-1,2};x1 = {-1,7};x2 = {5,3;-7,-2}{-5,0;7,-4}

Matrix Product

Plan to compute the product of matrices.

Description

This plan computes the matrix multiplication x0x1x2... to produce the output matrix.

Example

x0 = {1,0;-1,2};x1 = {-1;7};x2 = {5,3,2}{-5,-3,-2;75,45,30}

Matrix Solver

Plan to solve a matrix equation.

Description

This plan solves the matrix equation Ay = b to compute the output matrix y. A can be square (in a critically determined system), or non-square (in an under- or over-determined system). A can also be rank-deficient.

Example

A = {1,0,4;1,1,6;-3,0,-10};b = {-1;7;0}{5;11;-1.5}

Convolution - Full

Plan to compute the full convolution of two matrices.

Description

This plan computes the full 2D convolution of the matrix x and the specified kernel matrix y. The output matrix is large enough to include all partial convolutions.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};y = {0,-1,0;-1,5,-1;0,-1,0}{0,0,-1,-1,0,0;0,-1,3,3,-1,0;0,-1,2,2,-1,0;0,-1,2,2,-1,0;0,-1,2,2,-1,0;0,-1,3,3,-1,0;0,0,-1,-1,0,0}

Convolution - Central

Plan to compute the central convolution of two matrices.

Description

This plan computes the central 2D convolution of the matrix x and the specified kernel matrix y. The output matrix has the same dimensions as matrix x.

Example

x = {0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0;0,1,1,0};y = {0,-1,0;-1,5,-1;0,-1,0}{-1,3,3,-1;-1,2,2,-1;-1,2,2,-1;-1,2,2,-1;-1,3,3,-1}

Inner Product

Plan to compute the Frobenius inner product of two matrices.

Description

This plan computes the Frobenius inner product of matrices x and y, defined as the sum of x[i,j]*×y[i,j] across all rows and columns. This product is the same as the dot product of two vectors when x and y are row or column vectors. When the matrix dimensions differ, zero is used for out-of-range elements. To account for complex-valued results, the output is presented as a 1×1 matrix.

Example

x = {1,0.5;4,5};y = {4,-1;0,3}{18.5}
x = {1-I,0.5;4,5-I};y = {4+I,-1;0,3+I}{16.5+31I}


Highlight a Matrix

These plans produce a matrix by extracting information from another matrix.


Row Count

Plan to count matrix rows.

Description

This plan counts the number of rows, or the height m, of the matrix x.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{4}

Column Count

Plan to count matrix columns.

Description

This plan counts the number of columns, or the width n, of the matrix x.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{3}

Extract Along Rows - Expression

Plan to copy after applying an expression row by row.

Description

This plan copies the real part of the evaluation result of the expression f(i,j,x) for each row i and column j when applied along the rows. Here, f is a function of the row index (i), column index (j), and the element of the matrix x at row i and column j (x). Effectively, this plan converts the matrix into an array.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0};f = {imag(x)+i}{0,1,1,0,1,2,2,1,2,3,3,2}

Extract Along Columns - Expression

Plan to copy after applying an expression column by column.

Description

This plan copies the real part of the evaluation result of the expression f(i,j,x) for each row i and column j when applied along the columns. Here, f is a function of the row index (i), column index (j), and the element of the matrix x at row i and column j (x). Effectively, this plan converts the matrix into an array.

The complex expression parser supports the following:

  • Complex number representations: a, I, bI, and a+bI, where a and b are floating-point numbers, and I=√(-1).
  • Complex operations: real, imag, abs, arg, and conj.
  • Basic operations: addition (+), subtraction/negation (-), multiplication (*), division (/), and exponentiation (^).
  • Exponentiation functions: exp, pow, and sqrt.
  • Logarithmic functions: exp and log (natural logarithm with the branch cut along the negative real axis).
  • Trigonometric functions: sin, cos, tan, asin, acos, and atan.
  • Hyperbolic functions: sinh, cosh, tanh, asinh, acosh, and atanh.
  • Constants: pi and e.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0};f = {imag(x)+i}{0,1,2,1,2,3,1,2,3,0,1,2}

Extract Along Rows - Real Part

Plan to copy the real parts of elements row by row.

Description

This plan copies the real part of each element in the matrix x along the rows, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,0,0,2,3,0,0,3,2,0}

Extract Along Columns - Real Part

Plan to copy the real parts of elements column by column.

Description

This plan copies the real part of each element in the matrix x along the columns, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,0,2,3,0,3,2,0,0,0}

Extract Along Rows - Imaginary Part

Plan to copy the imaginary parts of elements row by row.

Description

This plan copies the imaginary part of each element in the matrix x along the rows, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,1,1,0,0,1,1,0,0,1,1,0}

Extract Along Columns - Imaginary Part

Plan to copy the imaginary parts of elements column by column.

Description

This plan copies the imaginary part of each element in the matrix x along the columns, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,1,1,1,1,1,1,0,0,0}

Extract Along Rows - Magnitude

Plan to copy the magnitudes of elements row by row.

Description

This plan copies the magnitude of each element in the matrix x along the rows, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,1,1,0,0,2.23607,3.16228,0,0,3.16228,2.23607,0}

Extract Along Columns - Magnitude

Plan to copy the magnitudes of elements column by column.

Description

This plan copies the magnitude of each element in the matrix x along the columns, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,1,2.23607,3.16228,1,3.16228,2.23607,0,0,0}

Extract Along Rows - Phase Angle

Plan to copy the phase angles of elements row by row.

Description

This plan copies the phase angle of each element in the matrix x along the rows, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,1.5708,1.5708,0,0,0.463648,0.321751,0,0,0.321751,0.463648,0}

Extract Along Columns - Phase Angle

Plan to copy the phase angles of elements column by column.

Description

This plan copies the phase angle of each element in the matrix x along the columns, effectively converting the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,1.5708,0.463648,0.321751,1.5708,0.321751,0.463648,0,0,0}

Extract Along Rows - Cartesian Pair

Plan to copy the real and imaginary parts of elements row by row.

Description

This plan copies the real and imaginary parts of each element in the matrix x, in order, along the rows. The first two values in the output array represent the real and imaginary parts of the first element; the next two values correspond to the second element, and so on. Effectively, this plan converts the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,1,0,1,0,0,0,0,2,1,3,1,0,0,0,0,3,1,2,1,0,0}

Extract Along Columns - Cartesian Pair

Plan to copy the real and imaginary parts of elements column by column.

Description

This plan copies the real and imaginary parts of each element in the matrix x, in order, along the columns. The first two values in the output array represent the real and imaginary parts of the first element; the next two values correspond to the second element, and so on. Effectively, this plan converts the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,0,0,0,0,1,2,1,3,1,0,1,3,1,2,1,0,0,0,0,0,0}

Extract Along Rows - Polar Pair

Plan to copy the magnitudes and phase angles of elements row by row.

Description

This plan copies the magnitude and phase angle of each element in the matrix x, in order, along the rows. The first two values in the output array represent the magnitude and phase angle of the first element; the next two values correspond to the second element, and so on. Effectively, this plan converts the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,1,1.5708,1,1.5708,0,0,0,0,2.23607,0.463648,3.16228,0.321751,0,0,0,0,3.16228,0.321751,2.23607,0.463648,0,0}

Extract Along Columns - Polar Pair

Plan to copy the magnitudes and phase angles of elements column by column.

Description

This plan copies the magnitude and phase angle of each element in the matrix x, in order, along the columns. The first two values in the output array represent the magnitude and phase angle of the first element; the next two values correspond to the second element, and so on. Effectively, this plan converts the matrix into an array.

Example

x = {0,I,I,0;0,2+I,3+I,0;0,3+I,2+I,0}{0,0,0,0,0,0,1,1.5708,2.23607,0.463648,3.16228,0.321751,1,1.5708,3.16228,0.321751,2.23607,0.463648,0,0,0,0,0,0}

Minimum in Rows

Plan to find minimums in rows.

Description

This plan finds the minimum in each row of the matrix x. The minimum is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{-1,2,-1,7}

Minimum in Columns

Plan to find minimums in columns.

Description

This plan finds the minimum in each column of the matrix x. The minimum is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{-1,2,-1}

Minimum in Matrix

Plan to find the minimum in matrix.

Description

This plan finds the minimum in the matrix x. The minimum is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{-1}

Index of Minimum in Rows

Plan to find the column indices of minimums in rows.

Description

This plan finds the column index of the minimum in each row of the matrix x. The minimum is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2,1,0,0}

Index of Minimum in Columns

Plan to find the row indices of minimums in columns.

Description

This plan finds the row index of the minimum in each column of the matrix x. The minimum is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2,0,0}

Index of Minimum in Matrix

Plan to find the position of minimum in matrix.

Description

This plan finds the position of the minimum in the matrix x. The first value in the output array is the row index and the second value is the column index of that element. The minimum is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2,0}

Maximum in Rows

Plan to find maximums in rows.

Description

This plan finds the maximum in each row of the matrix x. The maximum is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2,6,4,9}

Maximum in Columns

Plan to find maximums in columns.

Description

This plan finds the maximum in each column of the matrix x. The maximum is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{7,7,9}

Maximum in Matrix

Plan to find the maximum in matrix.

Description

This plan finds the maximum in the matrix x. The maximum is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{9}

Index of Maximum in Rows

Plan to find the column indices of maximums in rows.

Description

This plan finds the column index of the maximum in each row of the matrix x. The maximum is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{1,2,2,2}

Index of Maximum in Columns

Plan to find the row indices of maximums in columns.

Description

This plan finds the row index of the maximum in each column of the matrix x. The maximum is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{3,3,3}

Index of Maximum in Matrix

Plan to find the position of maximum in matrix.

Description

This plan finds the position of the maximum in the matrix x. The first value in the output array is the row index and the second value is the column index of that element. The maximum is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{3,2}

Median in Rows

Plan to find medians in rows.

Description

This plan finds the median in each row of the matrix x. The median is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{1,3,2,7}

Median in Columns

Plan to find medians in columns.

Description

This plan finds the median in each column of the matrix x. The median is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{1,2,4}

Median in Matrix

Plan to find the median in matrix.

Description

This plan finds the median in the matrix x. The median is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2}

Index of Median in Rows

Plan to find the column indices of medians in rows.

Description

This plan finds the column index of the median in each row of the matrix x. The median is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{0,0,1,1}

Index of Median in Columns

Plan to find the row indices of medians in columns.

Description

This plan finds the row index of the median in each column of the matrix x. The median is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{0,1,2}

Index of Median in Matrix

Plan to find the position of median in matrix.

Description

This plan finds the position of the median in the matrix x. The first value in the output array is the row index and the second value is the column index of that element. The median is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2,1}

Mode in Rows

Plan to find modes in rows.

Description

This plan finds the mode in each row of the matrix x. The mode is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{1,3,-1,7}

Mode in Columns

Plan to find modes in columns.

Description

This plan finds the mode in each column of the matrix x. The mode is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{1,2,-1}

Mode in Matrix

Plan to find the mode in matrix.

Description

This plan finds the mode in the matrix x. The mode is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{2}

Index of Mode in Rows

Plan to find the column indices of modes in rows.

Description

This plan finds the column index of the mode in each row of the matrix x. The mode is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{0,0,0,0}

Index of Mode in Columns

Plan to find the row indices of modes in columns.

Description

This plan finds the row index of the mode in each column of the matrix x. The mode is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{0,0,0}

Index of Mode in Matrix

Plan to find the position of mode in matrix.

Description

This plan finds the position of the mode in the matrix x. The first value in the output array is the row index and the second value is the column index of that element. The mode is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9}{0,1}

Percentile in Rows

Plan to find percentiles in rows.

Description

This plan finds the k-th percentile in each row of the matrix x. The k-th percentile is the smallest value at or below which k percent (k=1.0 for 100%) of the values fall. The percentile is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9};k = {0.7}{2,6,4,9}

Percentile in Columns

Plan to find percentiles in columns.

Description

This plan finds the k-th percentile in each column of the matrix x. The k-th percentile is the smallest value at or below which k percent (k=1.0 for 100%) of the values fall. The percentile is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9};k = {0.7}{3,2,6}

Percentile in Matrix

Plan to find the percentile in matrix.

Description

This plan finds the k-th percentile in the matrix x. The k-th percentile is the smallest value at or below which k percent (k=1.0 for 100%) of the values fall. The percentile is determined based on the real parts of the elements and is reported as the real part.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9};k = {0.7}{6}

Index of Percentile in Rows

Plan to find the column indices of percentiles in rows.

Description

This plan finds the column index of the k-th percentile in each row of the matrix x. The k-th percentile is the smallest value at or below which k percent (k=1.0 for 100%) of the values fall. The percentile is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9};k = {0.7}{1,2,2,2}

Index of Percentile in Columns

Plan to find the row indices of percentiles in columns.

Description

This plan finds the row index of the k-th percentile in each column of the matrix x. The k-th percentile is the smallest value at or below which k percent (k=1.0 for 100%) of the values fall. The percentile is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9};k = {0.7}{1,2,1}

Index of Percentile in Matrix

Plan to find the position of percentile in matrix.

Description

This plan finds the position of the k-th percentile in the matrix x. The k-th percentile is the smallest value at or below which k percent (k=1.0 for 100%) of the values fall. The first value in the output array is the row index and the second value is the column index of that element. The percentile is determined based on the real parts of the elements.

Example

x = {1,2,-1;3,2,6;-1,2,4;7,7,9};k = {0.7}{1,2}

Rank

Plan to compute the rank of matrix.

Description

This plan computes the rank of the matrix x.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{3}

Condition Number

Plan to compute the condition number of matrix.

Description

This plan computes the condition number, which is the ratio of the largest singular value to the smallest singular value, for the matrix x.

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9}{9.87909}

Matrix Norm

Plan to compute the p-norm of matrix.

Description

This plan computes the p-norm of the matrix x. The norm parameter p can be 1, 2, 0 (Frobenius norm), or inf (infinity norm).

Example

x = {1,0,-1;3,2,6;-1,1,4;7,8,9};p = {1}{20}
x = {1,0,-1;3,2,6;-1,1,4;7,8,9};p = {2}{15.689}


Post Matrices

These plans output matrices without producing any new data.


Export to Text File

Plan to export a matrix to a text file.

Description

This plan exports the matrix x to a text file with the given file name. Matrix rows are separated by new lines, and columns by the specified delimiter. If the append parameter is not empty, the matrix is appended to the end of the file. When specified, the format of the floating-point numbers is controlled by the width and precision parameters.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\output_mat.txt};append = {};delimiter = {, };width = {};precision = {}
x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\output_mat_w.txt};append = {};delimiter = {, };width = {8};precision = {3}

Export to Armadillo Binary File

Plan to export a matrix to an Armadillo library binary file.

Description

This plan exports the matrix x to an Armadillo library binary file with the given file name.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.bin}

Export to Armadillo Text File

Plan to export a matrix to an Armadillo library text file.

Description

This plan exports the matrix x to an Armadillo library text file with the given file name.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.txt}

Export to Armadillo Raw Binary File

Plan to export a matrix to an Armadillo library raw binary file.

Description

This plan exports the matrix x to an Armadillo library raw binary file with the given file name. In this file format, the matrix dimensions are not preserved, and the matrix is reduced to a column vector containing the underlying matrix data.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.raw_bin}

Export to Armadillo Raw Text File

Plan to export a matrix to an Armadillo library raw text file.

Description

This plan exports the matrix x to an Armadillo library raw text file with the given file name. In this file format, the matrix dimensions are inferred from the text structure.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.raw_txt}

Export to CSV File

Plan to export a matrix to a CSV file.

Description

This plan exports the matrix x to a Comma-Separated Values (CSV) file with the given file name.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.csv}

Export to Coordinate List File

Plan to export a matrix to a coordinate list file.

Description

This plan exports the matrix x to a coordinate list file with the given file name. In this file format, each line describes a nonzero element as "row column value", with row and column indices starting from 0.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.coord}

Export to PGM File

Plan to export a matrix to a PGM file.

Description

This plan exports the matrix x to a Portable Gray Map (PGM) file with the given file name. In this file format, the real parts of the elements are stored as integers between 0 and 255.

Example

x = {pi,2+I,3,4I;-pi,10,25-I,42};file name = {tests\matrix.pgm}