Try this:

`sortrows(a,2)`

This should sort according to the second column.

### Related Contents:

- How can I sort a 2-D array in MATLAB with respect to one column?
- Creating a square identity matrix [closed]
- How can I index a MATLAB array returned by a function without first assigning it to a local variable?
- Matrix of unknown length in MATLAB?
- How do you concatenate the rows of a matrix into a vector?
- How can I accumulate cells of different lengths into a matrix in MATLAB?
- How do I visualize a matrix with colors and values displayed?
- Is MATLAB row specific or column major?
- Use a vector as an index to a matrix
- Index of max and min value in an array
- How can I change the values of multiple points in a matrix?
- Construct adjacency matrix in MATLAB
- Replace specific columns in a matrix with a constant column vector
- How can I apply a function to every row/column of a matrix in MATLAB?
- How can I count the number of elements of a given value in a matrix?
- How to select a submatrix (not in any particular pattern) in Matlab
- Get the indices of the n largest elements in a matrix
- Multiply a 3D matrix with a 2D matrix
- How do I resize a matrix in MATLAB?
- Efficiently compute a 3D matrix of outer products – MATLAB
- Matrix “Zigzag” Reordering
- How can I divide each row of a matrix by a fixed row?
- Matlab: repeat every column sequentially n times [duplicate]
- Extracting the corresponding value of a rank vector in Matlab
- Generate random number with given probability matlab
- “Undefined function ‘function_name’ for input arguments of type ‘double’.”
- Finding K-nearest neighbors and its implementation
- How can I plot a function with two variables in Octave or Matlab?
- How should I update the data of a plot in Matlab?
- Array of Matrices in MATLAB
- How do I access structure fields dynamically?
- Plot a plane based on a normal vector and a point in Matlab or matplotlib
- How do I set default values for functions parameters in MATLAB?
- Suppress Output
- Suppressing a function’s command window output
- Faster version of find for sorted vectors (MATLAB)
- Why is reshape so fast? (Spoiler: Copy-on-Write)
- Fortran minimization of a function with additional arguments
- How do properties work in Object Oriented MATLAB?
- How do I get real integer overflows in MATLAB/Octave?
- How to deal with overflow and underflow?
- What are the best practices for floating-point comparisons in Matlab?
- What are the semantics of ‘end’ in Matlab?
- How can I program a GUI in MATLAB? [closed]
- Setting graph figure size
- How to plot a circle in Matlab?
- Matlab file name with zero-padded numbers
- How can I change the color of bars in bar graph?
- Octave/Matlab: Adding new elements to a vector
- How do I get the handles of all open figures in MATLAB