Turn a Matrix into a Row Vector in MATLAB Last Updated : 04 Jul, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report Conversion of a Matrix into a Row Vector. This conversion can be done using reshape() function along with the Transpose operation. This reshape() function is used to reshape the specified matrix using the given size vector. Syntax:reshape(A, sz) Parameters: This function accepts two parameters, which are illustrated below: A: This is the specified matrix of elements.sz: This is the specified size vector. Return Value: It returns the row vector of a given matrix. Example 1 Matlab % Conversion of a 2D matrix into its % row vector. A = [1 2; 3 4]; %Initializing a matrix % Calling the reshape() function % over the above matrix as its transpose % and size vector as 1,[] B = reshape(A.',1,[]) Output: Example 2 Matlab % MATLAB code for Conversion of a 3*3 % matrix into its row vector. A = [1 2 3; 4 5 6; 7 8 9]; % Initializing a 3*3 matrix % Calling the reshape() function % over the above matrix as its transpose % and size vector as 1,[] B = reshape(A.',1,[]) Output: Comment More infoAdvertise with us Next Article How to inverse a vector in MATLAB? K Kanchan_Ray Follow Improve Article Tags : Software Engineering MATLAB MATLAB-programs Similar Reads Turn an Array into a Column Vector in MATLAB Conversion of an Array into a Column Vector. This conversion can be done using a(:) operation. A(:) reshapes all elements of A into a single column vector. This has no effect if A is already a column vector. Example 1 Matlab % MATLAB code for Conversion of an array % into a column vector a = [2 4 6 1 min read How to inverse a vector in MATLAB? In this article, we are going to discuss the "Inversion of a vector" in MATLAB which can be done in three different approaches that are illustrated below: Method 1: By using flipud() function The flipud() function is used for flipping the specified vector's elements. Syntax: flipud(A) Here, flipud(A 2 min read How to swap elements in the matrix in MATLAB? In this article, we will see the swapping of elements into a matrix in MATLAB. Different methods are illustrated below: Method 1: By changing elements of rows and columns  In this method, we are simply changing the elements of particular rows and columns in the specified rows and columns respectivel 3 min read How to Permute the Rows and Columns in a Matrix on MATLAB? In this article, we will discuss how to find the permutation of the rows and columns in a Matrix with the help of multiple approaches Method 1In this approach, we are simply permuting the rows and columns of the matrix in the specified format of rows and columns respectively.  For column permutation 4 min read How to Remove Nan Values from a Matrix in MATLAB? Removal of Nan Values from a Matrix.There are multiple methods by which we can remove Nan values from a specified matrix:. Method 1: By using rmmissing( ) This function is used to remove missing entries or Nan values from a specified matrix. Syntaxrmmissing(A) Parameters: This function accepts a pa 2 min read Swapping Two Elements in Each Row of a Matrix Without Loop in MATLAB A Matrix is a two-layered cluster of numbers. In MATLAB, we can create a Matrix by entering components in each line as comma or space-delimited numbers and also, utilizing semicolons to stamp the finish of each line. Approach:Step 1: Pick 2 elements in a row using logical()Step 2: Get all possible C 2 min read Like