For more videos and resources on this topic, please visit http://ma.mathforcollege.com/mainindex/01introduction/ Draw out a rectangle (it doesnât have to match the proportions given, just a rectangle shape will do) and mark out a diagonal line to create 2 triangles. Ask Question Asked 5 years, 9 months ago. To complete the second of the harlequin diamonds, follow the diagonal line into the dark area, when it changes the values in the woman’s extended arm down to the eyes of the female figure below her, arms slightly cast behind her. What are the dimensions of a matrix? diagonal matrix synonyms, diagonal matrix pronunciation, diagonal matrix translation, English dictionary definition of diagonal matrix. Login . Active 1 year, 4 months ago. For example, the matrix is a 3 ×4 rectangular diagonal matrix and is a 5 ×3 rectangular diagonal matrix. A diagonal is present in a rectangular matrix only when the rectangular matrix is a square (As all squares are rectangles but not all rectangles are squares rule of thumb). What are synonyms for Rectangular diagonal matrix? In addition, m >> n, and M is constant throughout the course of the algorithm, with only the elements of D changing. Ask Question Asked 1 year, 4 months ago. If the entries in the matrix are all zero except the ones on the diagonals from lower left corner to the other upper side(right) corner are not zero, it is anti diagonal matrix. A5 = [-1 4 0 0 0; 4 -1 4 0 0; 0 4 -1 4 0; 0 0 4 -1 4; 0 0 0 4 -1]; (1) Row Matrix: Row matrix is a type of matrix which has just one row. There are many types of matrices like the Identity matrix.. Properties of Diagonal Matrix Definition. What does it mean to find the diagonal of a rectangle? 3 $\begingroup$ Suppose you have the following diagonal matrix: $\left( \begin{array}{cc} a & 0 \\ 0 & \{b,c\} \end{array} \right)$ How can the above matrix be converted to the following rectangular one What is the equivalent of block diagonal matrix but for rectangular matrices? Property 1: If addition or multiplication is being applied on diagonal matrices, then the matrices should be of the same order. If you have a visual of your rectangle, it will be a lot easier to figure out the area given a diagonal. A00 A01 A02 A03 A10 A11 A12 A13 A20 A21 A22 A23 A30 A31 A32 A33 The primary diagonal is … Scalar Matrix. The solution below has several problems : the diagonal terms aren't really aligned in the first half, and the diagonal dots \ddots aren't steep enough between the zeros in the second half. Ask Question Asked 7 days ago. A00 A01 A02 A03 A10 A11 A12 A13 A20 A21 A22 A23 A30 A31 A32 A33 The primary diagonal is formed by the elements A00, A11, A22, A33. Diagonal matrices always come under square matrices. Viewed 612 times 7. Types of Matrices: There are different types of matrices like rectangular matrix, null matrix, square matrix, diagonal matrix etc. Your email address will not be published. All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This is instead of the real number not being zero to have an inverse, the determinant must not be zero to have an inverse. A square matrix D = [dij]n x n will be called a diagonal matrix if dij = 0, whenever i is not equal to j. optional 1) rectangular matrix , 2) diagonal matrix , 3) square matrix , 4) scaler matrix A square matrix D = [d ij] n x n will be called a diagonal matrix if d ij = 0, whenever i is not equal to j. A rectangle has two diagonals, and each is the same length. If v is a 2-D array, return a copy of its k-th diagonal. \(\begin{bmatrix} 6 & 0\\ 0 & 7 \end{bmatrix}\), Property 2: Transpose of the diagonal matrix D is as the same matrix. Information and translations of diagonal matrix in the most comprehensive dictionary definitions resource on the web. ... Is there a name for this type of block matrix? Further, C can be computed more efficiently than naively doing a full matrix multiplication: c ii = a ii b ii, and all other entries are 0. ii. 21.1.1 Creating Diagonal Matrices. In such type of square matrix, off-diagonal blocks are zero matrices and main diagonal blocks square matrices. A square matrix D = [d ij] n x n will be called a diagonal matrix if d ij = 0, whenever i is not equal to j. A straight path that connects the entries (or elements) whose row and column are the same in a square matrix is called the main diagonal of a square matrix. Diagonal matrix is also rectangular diagonal in nature. For variable-size inputs that are not variable-length vectors (1-by-: or :-by-1), diag treats the input as a matrix from which to extract a diagonal vector. https://www.thefreedictionary.com/Rectangular+diagonal+matrix, where U is an m x m unitary matrix (orthogonal matrix); the matrix P is an m x n, where [[sigma].sub.n] is the nth nonnegative singular value of the, multiplying regular matrices from both sides of M), we have a, Dictionary, Encyclopedia and Thesaurus - The Free Dictionary, the webmaster's page for free fun content, TerraSAR-X StripMap data interpretation of complex urban scenarios with 3D SAR tomography. However, few elements of the main diagonal can be zero but not all elements. A square matrix is said to be diagonal matrix if the elements of matrix except main diagonal are zero. Noun 1. diagonal matrix - a square matrix with all elements not on the main diagonal equal to zero square matrix - a matrix â¦ The central lighting on the painting Guernica by Pablo Picasso, surrounded by the darker background 1000 Words | 4 Pages. Ask Question Asked 1 year, 4 months ago. For general rectangular matrix!with dimensions (×*, the reduced SVD is: •Therankof A equals the number of non-zero singular values which is the same as the number of non-zero diagonal elements in Σ . 2 words related to diagonal matrix: square matrix, scalar matrix. Here, I wish to draw a rectangle around the principal diagonal elements (red colored) of the below matrix. The most common and easiest way to create a diagonal matrix is using the built-in function diag.The expression diag (v), with v a vector, will create a square diagonal matrix with elements on the main diagonal given by the elements of v, and size equal to the length of v.diag (v, m, n) can be used to construct a rectangular diagonal matrix. There are many types of matrices like the Identity matrix.. Properties of Diagonal Matrix Generally, finding the diagonal of a rectangle means to find the length of the rectangle diagonal. Your email address will not be published. MWE: \documentclass{article} \usepackage{amsmath,xcolor} \begin{document} Here, I wish to draw a rectangle around the principal diagonal elements (red colored) of the below matrix. I want to have a diagonal bloc matrix. ; Overall time complexity of this solution would be O(n 6). How do I display truly diagonal matrices? Have you met a specific rectangle problem and you don't know how to find the diagonal of a rectangle?Try entering a couple of parameters in the fields beside the text or keep reading to find out what are the possible diagonal of a rectangle formulas. Matrices are, a rectangular block of numbers arranged into rows and columns. Diagonal of rectangle refers to the line segment or straight line that connect the opposite corner or vertex of the rectangle. Block Diagonal Matrix. Matrix, define, type of matrices, Rectangular Matrix, Square Matrix, Diagonal matrix, Scalar Matrix, Transpose, symmetric, skewsymmetric matrix According to the Pythagorean theorem, the diagonal value can be found knowing the side length. Rectangle prism has six flat faces and all angles are right angles and have the same cross-section along a length. Let’s learn about the properties of the diagonal matrix now. There are many types of matrices like the Identity matrix. Learn via an example what is a diagonal matrix. We can generalize matrix inverses from non-singular square matrices to rectangular matrices in general, for example, the well-known Moore–Penrose pseudoinverse. I traced the problem to the determination of the row count for the Diagonal expression in Core/Diagonal.h, and found a FIXME comment indicating the calculation was known to be incorrect. For variable-size inputs that are not variable-length vectors (1-by-: or :-by-1), diag treats the input as a matrix from which to extract a diagonal vector. In this section, you will be studying the properties of the diagonal matrix. I am wondering how this can be done for eigenvalues and eigenvectors. 3 $\begingroup$ Suppose you have the following diagonal matrix: $\left( \begin{array}{cc} a & 0 \\ 0 & \{b,c\} \end{array} \right)$ How can the above matrix be converted to the following rectangular one If a is 2-D and not a matrix, a 1-D array of the same type as a containing the diagonal is returned. A diagonal is a straight line that connects one corner of a rectangle to the opposite corner. Diagonal Matrix. 2 words related to diagonal matrix: square matrix, scalar matrix. When D is an m × n (rectangular) diagonal matrix, its pseudo-inverse D + is an n × m (rectangular) diagonal matrix whose non-zero entries are the reciprocals 1 /d k of the non-zero diagonal entries of D. Thus a matrix A having SVD A = U Î£ V T has A + = V Î£ + U T. The default is 0. Use our online diagonal of a rectangle calculator to find diagonal of rectangle by entering the width and height. ... A diagonal matrix has zero entries all over the matrix except in the main diagonal. MWE: \documentclass{article} \usepackage{amsmath,xcolor} \begin{document} Here, I wish to draw a rectangle around the principal diagonal elements (red colored) of the below matrix. Rectangular Matrix Diagonal Tue Jul 10, 2012 7:59 am I recently encountered an odd problem while setting the diagonal of a rectangular matrix. The secondary diagonal is formed by the elements A03, A12, A21, A30. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. 21.2.1 Expressions Involving Diagonal Matrices. The matrix must be square (same number of rows and columns). This is for “perfect diagonals”. '. Synonyms for Rectangular diagonal matrix in Free Thesaurus. Similarly, M*D will do a column scaling. A square matrix in which every element except the principal diagonal elements is zero is called a Diagonal Matrix. CBSE Previous Year Question Papers Class 10, CBSE Previous Year Question Papers Class 12, NCERT Solutions Class 11 Business Studies, NCERT Solutions Class 12 Business Studies, NCERT Solutions Class 12 Accountancy Part 1, NCERT Solutions Class 12 Accountancy Part 2, NCERT Solutions For Class 6 Social Science, NCERT Solutions for Class 7 Social Science, NCERT Solutions for Class 8 Social Science, NCERT Solutions For Class 9 Social Science, NCERT Solutions For Class 9 Maths Chapter 1, NCERT Solutions For Class 9 Maths Chapter 2, NCERT Solutions For Class 9 Maths Chapter 3, NCERT Solutions For Class 9 Maths Chapter 4, NCERT Solutions For Class 9 Maths Chapter 5, NCERT Solutions For Class 9 Maths Chapter 6, NCERT Solutions For Class 9 Maths Chapter 7, NCERT Solutions For Class 9 Maths Chapter 8, NCERT Solutions For Class 9 Maths Chapter 9, NCERT Solutions For Class 9 Maths Chapter 10, NCERT Solutions For Class 9 Maths Chapter 11, NCERT Solutions For Class 9 Maths Chapter 12, NCERT Solutions For Class 9 Maths Chapter 13, NCERT Solutions For Class 9 Maths Chapter 14, NCERT Solutions For Class 9 Maths Chapter 15, NCERT Solutions for Class 9 Science Chapter 1, NCERT Solutions for Class 9 Science Chapter 2, NCERT Solutions for Class 9 Science Chapter 3, NCERT Solutions for Class 9 Science Chapter 4, NCERT Solutions for Class 9 Science Chapter 5, NCERT Solutions for Class 9 Science Chapter 6, NCERT Solutions for Class 9 Science Chapter 7, NCERT Solutions for Class 9 Science Chapter 8, NCERT Solutions for Class 9 Science Chapter 9, NCERT Solutions for Class 9 Science Chapter 10, NCERT Solutions for Class 9 Science Chapter 12, NCERT Solutions for Class 9 Science Chapter 11, NCERT Solutions for Class 9 Science Chapter 13, NCERT Solutions for Class 9 Science Chapter 14, NCERT Solutions for Class 9 Science Chapter 15, NCERT Solutions for Class 10 Social Science, NCERT Solutions for Class 10 Maths Chapter 1, NCERT Solutions for Class 10 Maths Chapter 2, NCERT Solutions for Class 10 Maths Chapter 3, NCERT Solutions for Class 10 Maths Chapter 4, NCERT Solutions for Class 10 Maths Chapter 5, NCERT Solutions for Class 10 Maths Chapter 6, NCERT Solutions for Class 10 Maths Chapter 7, NCERT Solutions for Class 10 Maths Chapter 8, NCERT Solutions for Class 10 Maths Chapter 9, NCERT Solutions for Class 10 Maths Chapter 10, NCERT Solutions for Class 10 Maths Chapter 11, NCERT Solutions for Class 10 Maths Chapter 12, NCERT Solutions for Class 10 Maths Chapter 13, NCERT Solutions for Class 10 Maths Chapter 14, NCERT Solutions for Class 10 Maths Chapter 15, NCERT Solutions for Class 10 Science Chapter 1, NCERT Solutions for Class 10 Science Chapter 2, NCERT Solutions for Class 10 Science Chapter 3, NCERT Solutions for Class 10 Science Chapter 4, NCERT Solutions for Class 10 Science Chapter 5, NCERT Solutions for Class 10 Science Chapter 6, NCERT Solutions for Class 10 Science Chapter 7, NCERT Solutions for Class 10 Science Chapter 8, NCERT Solutions for Class 10 Science Chapter 9, NCERT Solutions for Class 10 Science Chapter 10, NCERT Solutions for Class 10 Science Chapter 11, NCERT Solutions for Class 10 Science Chapter 12, NCERT Solutions for Class 10 Science Chapter 13, NCERT Solutions for Class 10 Science Chapter 14, NCERT Solutions for Class 10 Science Chapter 15, NCERT Solutions for Class 10 Science Chapter 16, CBSE Previous Year Question Papers Class 12 Maths, CBSE Previous Year Question Papers Class 10 Maths, ICSE Previous Year Question Papers Class 10, ISC Previous Year Question Papers Class 12 Maths. Required fields are marked *. Express a matrix as the sum of its diagonal and off-diagonal parts: Verify the similarity of a matrix to the diagonal matrix of its eigenvalues: Define a Jordan matrix: Construct a 5 × 5 tridiagonal matrix: This can also be done using Band: Extract the diagonal from a diagonal rectangular matrix: A matrix is diagonal if all elements above and below the main diagonal are zero. Matrices where (number of rows) = (number of columns) For the matrices with whose number of rows and columns are unequal, we call them rectangular matrices. The scalar matrix is square matrix and its diagonal elements are equal to the same … For a rectangular matrix the way of finding diagonal elements remains same, i.e. Mathematically, it states to a set of numbers, variables or functions arranged in rows and columns. How to convert diagonal matrix to rectangular matrix. This solution requires 6 nested loops â 4 for start and end coordinate of the 2 axis O(n 4); and 2 for the summation of the sub-matrix O(n 2). Properties of Diagonal Matrix. A matrix is a rectangular array of numbers (or other mathematical objects) for which operations such as addition and multiplication are defined. Our diagonal of a rectangle calculator is an extensive tool that quickly finds the diagonal and other parameters of a rectangle. If a is a matrix, a 1-D array containing the diagonal is returned in order to maintain backward compatibility. The Naive Solution for this problem is to check every possible rectangle in given 2D array. Antonyms for Rectangular diagonal matrix. Columns 5 to 9 are all zero as the matrix is not a square matrix. collapse all. According to the Pythagorean theorem, the diagonal value can be found knowing the side length. Multiplication of diagonal matrices is commutative: if A and B are diagonal, then C = AB = BA.. iii. Further, C can be computed more efficiently than naively doing a full matrix multiplication: c ii = a ii b ii, and all other entries are 0. ii. Example: Hence, this is the diagonal matrix. S(i,j) = D(i,i) * M(i,j). where M is a m*n dense rectangular matrix (with no specific structure), and D is a m*m diagonal matrix with all positive elements. A matrix which is split into blocks is called a block matrix. Here, the non-diagonal blocks are zero. D = DT, If p = \(\begin{bmatrix} 2 & 0\\ 0 & 4 \end{bmatrix}\) then, PT = \(\begin{bmatrix} 2 & 0\\ 0 & 4 \end{bmatrix}\), Property 3: Under Multiplication, Diagonal Matrices are commutative, i. e. PQ = QP, If P = \(\begin{bmatrix} 2 & 0\\ 0 & 4 \end{bmatrix}\) and Q = \(\begin{bmatrix} 4 & 0\\ 0 & 3 \end{bmatrix}\), P x Q = \(\begin{bmatrix} 8+0 & 0 + 0 \\ 0 + 0 & 12+0 \end{bmatrix}\) A matrix is a rectangular array of numbers (or other mathematical objects) for which operations such as addition and multiplication are defined. $\begingroup$ One can take a diagonal of the largest non-singular square submatrix to be the "main diagonal" $\endgroup$ – DVD May 13 '13 at 8:56 add a comment | 1 Answer 1 Synonyms for Rectangular diagonal matrix in Free Thesaurus. Another approach, that also works for a general plate (or body when using three dimension), would be to start with the moment of inertia, I, around the center of the plate expressed as a 2x2 matrix, which for a rectangular plate is a nice simple diagonal matrix.From this matrix you can find the moment of inertia around any axis n as I n = n T I n where n T is the transpose of n. 2 is not part of diagonal â¦ The matrices can be either square or rectangular and can differ in size. Assume D is a diagonal matrix. The ... For example, the following matrix is diagonal: The term diagonal matrix may sometimes refer to a rectangular diagonal matrix, which is an m-by-n matrix with only the entries of the form di,i possibly non-zero. Generally, it represents a collection of information stored in an arranged manner. The central lighting on the painting Guernica by Pablo Picasso, surrounded by the darker background 1000 Words | 4 Pages. For example, In above example, Matrix A has 3 rows and 3 columns. Rectangular diagonal matrix synonyms, Rectangular diagonal matrix pronunciation, Rectangular diagonal matrix translation, English dictionary definition of Rectangular diagonal matrix. Matrices are represented by the capital English alphabet like A, B, C……, etc. If M is a full matrix, then D*M will scale the rows of M.That means, if S = D*M, then for each pair of indices i,j it holds . numpy.diagonal¶ numpy.diagonal (a, offset=0, axis1=0, axis2=1) [source] ¶ Return specified diagonals. Property 1: Same order diagonal matrices gives a diagonal matrix only after addition or multiplication. Let D = \(\begin{bmatrix} a_{11} & 0& 0\\ 0 & a_{22} & 0\\ 0& 0 & a_{33} \end{bmatrix}\), Adj D = \(\begin{bmatrix} a_{22}a_{33} & 0& 0\\ 0 & a_{11}a_{33} & 0\\ 0& 0 & a_{11}a_{22} \end{bmatrix}\), = \(\frac{1}{a_{11}a_{22}a_{33}} \begin{bmatrix} a_{22}a_{33} & 0& 0\\ 0 & a_{11}a_{33} & 0\\ 0& 0 & a_{11}a_{22} \end{bmatrix}\) If a is 2-D, returns the diagonal of a with the given offset, i.e., the collection of elements of the form a[i, i+offset].If a has more than two dimensions, then the axes specified by axis1 and axis2 are used to determine the 2-D sub-array whose diagonal is returned. If the elements on the main diagonal are the inverse of the corresponding element on the main diagonal of the D, then D is a diagonal matrix. Register at BYJU’S to study many more interesting mathematical topics and concepts. For example, if a matrix has 2 rows and 3 columns then it is called a Rectangular Matrix as given below. number or rows and columns should be equal, as shown below. For example, consider the following 4 X 4 input matrix. A square null matrix is also a diagonal matrix whose main diagonal â¦ Use our online diagonal of a rectangle calculator to find diagonal of rectangle by entering the width and height. When D is an m × n (rectangular) diagonal matrix, its pseudo-inverse D + is an n × m (rectangular) diagonal matrix whose non-zero entries are the reciprocals 1 /d k of the non-zero diagonal entries of D. Thus a matrix A having SVD A = U Σ V T has A + = V Σ + U T. Examples of how to use âdiagonal matrixâ in a sentence from the Cambridge Dictionary Labs To complete the second of the harlequin diamonds, follow the diagonal line into the dark area, when it changes the values in the womanâs extended arm down to the eyes of the female figure below her, arms slightly cast behind her. \(\begin{bmatrix} 8 & 0\\ 0 & 12 \end{bmatrix}\). A matrix that does not have an inverse is called singular. A new example problem was added.) Here, I wish to draw a rectangle around the principal diagonal elements (red colored) of the below matrix. All the other values can be zero. More About. 6. Diagonalize the matrix A=[4−3−33−2−3−112]by finding a nonsingular matrix S and a diagonal matrix D such that S−1AS=D. The matrix is a diagonal matrix. As an example, we solve the following problem. Diagonal of rectangle refers to the line segment or straight line that connect the opposite corner or vertex of the rectangle. Viewed 61k times 27. Dij = 0 when i is not equal to j, then D is called a block diagonal matrix. The determinant of the matrix must not be zero . If A and B are diagonal, then C = AB is diagonal. How to convert diagonal matrix to rectangular matrix. Multiplication of diagonal matrices is commutative: if A and B are diagonal, then C = AB = BA.. iii. A rectangle prism is a one which is a rectangle cuboid. Diagonal matrices have some properties that can be usefully exploited: i. 4. Introduction In a square matrix , the total number of elements in a row is equal to the total number of elements in a column. Rectangle Diagonal Matrix In this example, we create a rectangular 4x9 matrix with integer numbers from the range 0 to 9 (both inclusive) as the diagonal elements. If P = \(\begin{bmatrix} 2 & 0\\ 0 & 4 \end{bmatrix}\), and Q = \(\begin{bmatrix} 4 & 0\\ 0 & 3 \end{bmatrix}\), P + Q = \(\begin{bmatrix} 2 & 0\\ 0 & 4 \end{bmatrix} + \begin{bmatrix} 4 & 0\\ 0 & 3 \end{bmatrix}\), P + Q = \(\begin{bmatrix} 2 + 4 & 0 + 0 \\ 0+0 & 4 + 3\end{bmatrix}\) For example, This behavior occurs even if the input array is a vector at run time. Required: k: Diagonal in question. Definition. This post covers overview of different types of matrices. If A and B are diagonal, then C = AB is diagonal. If all the elements of a square matrix are zero except those in the main diagonal, then it is called a Diagonal Matrix. The pseudoinverse of a rectangular diagonal matrix is again a rectangular diagonal matrix with swapped dimensions, where each nonzero diagonal element is replaced by its reciprocal. Add to solve later Sponsored Links If you know side lengths of the rectangle, you can easily find the length of the diagonal using the Pythagorean Theorem, since a diagonal divides a rectangle into two right triangles. Diagonal matrix is a type of matrix in which diagonal elements are non-zero and non-diagonal elements are zero. \(\begin{bmatrix} 8 & 0\\ 0 & 12 \end{bmatrix}\), Q x P = \(\begin{bmatrix} 8+0 & 0 + 0 \\0 + 0& 12+0 \end{bmatrix}\) Express a matrix as the sum of its diagonal and off-diagonal parts: Verify the similarity of a matrix to the diagonal matrix of its eigenvalues: Define a Jordan matrix: Construct a 5 × 5 tridiagonal matrix: This can also be done using Band: Extract the diagonal from a diagonal rectangular matrix: If v is a 1-D array, return a 2-D array with v on the k-th diagonal. For example, the 4-by-4 identity matrix, Active 1 year, 4 months ago. Consider the following 4 X 4 input matrix. This behavior occurs even if the input array is a vector at run time. To my knowledge, block diagonal matrices refer to matrices with square matrices along the diagonal and zeroes everywhere else. Viewed 612 times 7. Condition for Principal Diagonal: The row-column condition is row = column. If any of the input matrices are sparse, then the output block diagonal matrix is also sparse. Mark the diagonal on the rectangle. The matrix D may also be rectangular, m-by-n where m != n.If m < n, then the expression D*M is equivalent to It can have multiple columns but there is just a single row present in a row matrix. Find out information about Rectangular diagonal matrix. Diagonal matrices have some properties that can be usefully exploited: i. Any number of the elements on the main diagonal can also be zero. How to convert a column or row matrix to a diagonal matrix in Python? This online diagonal of rectangle prism calculator helps you by providing the answer to your question of 'How to find the diagonal of a prism? A square matrix in which every element except the principal diagonal elements is zero is called a Diagonal Matrix. Types of diagonal matrix are as follows, 1) Rectangular diagonal matrix, 2) Symmetric diagonal and 3) Scalar matrix. A matrix whose nonzero entries all lie on the principal diagonal Explanation of Rectangular diagonal matrix If we consider this image, the dimensions of this matrix A is 2 x 3. (Update 10/15/2017. Define diagonal matrix. A square matrix in which every element except the principal diagonal elements is zero is called a Diagonal Matrix. Active 1 year, 10 months ago. \(\begin{bmatrix} \frac{1}{a_{11}} &0 & 0\\ 0 & \frac{1}{a_{22}} &0 \\ 0& 0 & \frac{1}{a_{33}} \end{bmatrix}\). What are synonyms for Rectangular diagonal matrix? I am having trouble creating this matrix in matlab, basically I need to create a matrix that has -1 going across the center diagonal followed be 4s on the diagonal outside of that (example below). I have a row vector A, A = [a1 a2 a3 ..... an] and I would like to create a diagonal matrix, B = diag(a1, a2, a3, ....., an) with the elements of this row vector. Use k>0 for diagonals above the main diagonal, and k<0 for diagonals below the main diagonal. Looking for Rectangular diagonal matrix? In this post, we explain how to diagonalize a matrix if it is diagonalizable. Antonyms for Rectangular diagonal matrix.